PDA

View Full Version : Simple Upload Not Working...please help


mail350400
03-07-2009, 07:24 PM
Hello everyone,

I am hoping that someone can offer some help. I want to create a page where customers can upload a picture to a directory on my server. I have been trying to create a simple test page just to see if the upload works and it doesn't.

I created the file field and the submit button and used Digital File Pro to take care of all of the restrictions, etc. I've tested it both locally and on my web server. The file will not upload. In fact, I don't even think the file information is being sent to the HelperPHP file. I am able to browse for the file I want to upload and the info is filled into the file field. However, when I press submit, it seems to do nothing more than reset the form. My test page reloads with a blank file field, and the "uploaded" file is no where to be found.

I followed the simple file upload instructions that came with DFP. I set max file size and I have it set to only accept web images. I tried uploading text files to see if I would get the proper error messages but nothing happens. I even placed echo statements in the code to print out the values of all the variables. When I press submit, the file field goes blank, the values of all the restrictions I chose appear but the value of $uploadedFile comes out completely blank. I can only assume the uploaded file information is not even making it to the HelperPHP file.

Is there something simple that I am missing? Are there any known bugs with DFP? I just want to create a blank test page with nothing more than a file field and submit button to upload a file. There's not much documentation that comes with DFP so I have absolutely no where else to turn.

I know there is simple php code out there for uploading a file...I've tried it, and it works. But I need the restrictions that DFP can put on file type and size, and the error messages that come along with them. But most of all DFP costs $$$ and I would like it to actually work!

Thanks to anyone who takes the time to read this.

Danilo Celic
03-08-2009, 03:27 PM
DFP adds several data bindings to the page to assist in debugging file upload issues. If you open the Bindings panel on your upload page, you should see two entries in the Bindings panel:
"WA Upload Files Global Status" and when expanded, a "Debug Info" item within it.
"WA Upload Files (fileFieldName)" and when expanded, a number of entries, including a "Debug Info" entry.

If you drag the Debug Info item onto your page, and then attempt the upload, you may see more info about what info PHP has on the file that was uploaded (or rather attempted to be uploaded).

You could also post a link to a page that exhibits this issue. Perhaps there is a problem with the coding of the form itself that is causing this issue.

Beyond that, we do have free support, so please do submit a support incident (http://www.webassist.com/mywebassist/techsupportinsert_1.php) if you need to.

mail350400
03-09-2009, 07:51 PM
Thank you for your reply. It's very useful to see the information and status codes on the file that is being uploaded. I got my sample page to work. It evens shows error messages to the uploader if the file is too large or the wrong type. But now I have another question.

What do I need to do if I have more than one file field? I would like to have 5 file fields and one submit button so customers can upload 5 images at once. Do I need to make each file field its own separate form? I would also like individual error messages to appear for each file that was uploaded if there was a problem. I tried this with separate forms for each file field and tried to upload 2 good files, and 3 problem files that would create 3 different status codes. I pressed submit and got the same error message five times...and no files uploaded, not even the good image files.

How do I set up the form(s) if I want to have more than one file field?

Danilo Celic
03-09-2009, 10:11 PM
If you want multiple files to be uploaded at one time, then you have to have the file fields within the same form. If you have 5 file fields, then you can have them all within one form, but you would need to apply the DFP Upload for each file field you want to upload from, so in this case you'd have it applied 5 times. Each instance should have its own set of status messages (including errors)

mail350400
03-10-2009, 02:05 PM
Got it! It works. Thank you so much for your help.