Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 08:16
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  PHP, Perl, ASP, JSP, CFM (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis, nothingGrinder)
| | |-+  AS2 file upload - onComplete fired without any file in the upload dir
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: AS2 file upload - onComplete fired without any file in the upload dir  (Read 1141 times)
secoe
Server what's that
*
Posts: 2


View Profile
« on: 08/31/10, 05:18 »

my listener.onComplete = function(selectedFile:FileReference) is fired without any file in the upload dir. if the file is small and I wait a bit I can see the file (through FTP) coming up on the server, but most of the times the "onComplete" if fired without any file being saved.

can I add something to this php code to make sure the file is uploaded? thank you

Code:
$folderloc = $_GET['l'];; 

if(!is_dir("./$folderloc")) mkdir("./$folderloc", 0755); 

if(move_uploaded_file($_FILES['Filedata']['tmp_name'], "./$folderloc/".$_FILES['Filedata']['name'])){ 
   chmod("./$folderlocs/".$_FILES['Filedata']['name'], 0777); 
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #1 on: 08/31/10, 06:28 »

reason could be the configuration of max file size at your server.

The file is unsualy uploaded into a temporary area outside of the webspace.
The it is inspected and checked against conditions, like file type and file size.
If they dont match the server settings, the file is deleted, else it is moved to the target folder.
You can find those settings inside of you php.ini
Logged

happy flashing
Cool
Ronald
secoe
Server what's that
*
Posts: 2


View Profile
« Reply #2 on: 08/31/10, 09:57 »

Thank you for your answer. I checked with several file sizes. Some files of the same, superior or inferior size worked and others didn't, I kept pressing refresh on the FTP client amazed why 2KB files didn't get there and 1MB ones did.

But your tip sent me on the right track.  I think the "onComplete" is sent for that temp file you wrote about, so he wasn't waiting for the "move" bit. I checked the upload dir and it was missing the write permission (duh).

I never thought about that because some files got uploaded. But it turned out it was only working for files with the same name, they were already there with write permission and the script overwrote them. It couldn't create new ones but sent that "onComplete" anyway.

Well, it's solved!!! Thanks again for the help.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!