Page 1 of 1
file uploading problem [solved]
Posted: 13 Mar 2008, 09:50
by nerrad
the system i used is SmartFoxServer 1.6.1 free edition with flex 3 sdk.
whenever i try to upload file by using
i received an warning on serverside which said
18:29:09.921 - [ WARNING ] > Invalid user upload from: 192.168.1.100
192.168.1.100 was my pc ip, my server and client both residing on the same pc. was this message triggered by security or invalid FileFeference?
i have tried imageManager tutorial it worked flawlessly, and i have read the tutorial 5 times, but i couldn't find a solution to this problem. i believe the problem is caused by my client wasn't setup correctly but i couldn't open the tutorial imagemanger.fla because i don't have flash 8 installed. could any help me please?
Posted: 13 Mar 2008, 17:24
by csharpjava
yes. i would try getting flash 8 and trying it again.
Posted: 13 Mar 2008, 19:00
by nerrad

thanks anyway
Posted: 14 Mar 2008, 09:57
by Lapo
There's no good reason why it should not work from Flex

Before uploading you should make sure that your client is joined in a room, is this happening?
In order to check the ImageManager example get a trial of Flash CS3 from Adobe's website
Posted: 14 Mar 2008, 18:29
by nerrad
yes i'm 100% sure it was connected to a room, because i could get a file list from server.
i'm lucky enough to get a flash 8 trial version, but i have a hard time to compile or "publish" the imageManager tutorial, flex is so much easier
anyway, i would like to list down the way i did it in flex and hopefully somebody could spot the error for me
Server-side
===========
- do nothing
Client-side
===========
1) create a fileReference object
private var fileRef:FileReference = new FileReference;
2) register file uploading event handler
fileRef.addEventListener(Event.SELECT, selectHandler);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
3) open file browser dialogbox
fileRef.browse(types);
4) upload the selected file
private function selectHandler(evt:Event):void {
sfs.uploadFile(fileRef);
}
5) display result after uploading
private function completeHandler(evt:Event):void {
mDebug.text = "done";
}
help me please and thanks in advance
Posted: 15 Mar 2008, 06:09
by nerrad
i found the problem, it was caused by upload.py limit the filesize to 1mb.
while editing the upload.py file, i noticed the uploadPath (or uploadDir) can be changed too, but after restarting the server, getUploadPath() still return the the default path, is there a way to fix this?
Posted: 15 Mar 2008, 10:08
by Lapo
You should change the self.uploadDir variable pointing it to another existing folder
Posted: 16 Mar 2008, 01:03
by nerrad
yes, that was the variable i'd changed. my problem is, on client side the SmartFoxClient.getUploadPath() still return me the default upload path not the new one.
Posted: 17 Mar 2008, 07:17
by Lapo
getUploadPath() uses the default location established by SmartFoxServer.
If you want to use another location you should keep track of the new URL in your code.
Please, remember that if you want to access the uploaded files after they have been submitted they should be located in a folder that is "seen" by the web-server.
regards
Posted: 17 Mar 2008, 13:56
by nerrad

thanks! i guess this is the only way to do it for now