Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need a modern, robust file uploader, multiple files with text fields

Need a modern, robust file uploader, multiple files with text fields

Need a modern, robust file uploader, multiple files with text fields

I have an ancient PHP multi-file upload form & script that's become something of a problem. It's fine for uploading relatively small files (50mb), but chokes on anything much larger, even with upload_max_filesize() bumped as high as 5gb.

When it chokes on larger files, I don't see any errors in the browser or the error_log, the file being uploaded just vanishes. I host with a budget shared hosting outfit, so I don't have a lot of access to the system beyond php.ini & .htaccess, etc., so I'm kind of at a loss to figure out what's happening.

The form I'm using is shown in the attachment, but basically I need multiple upload slots and a way to associate multiple form fields (user-input file description, a couple SELECT's and checkboxes, etc..) with each file being uploaded for post processing.

I'm looking at a jQuery library (https://github.com/blueimp/jQuery-File-Upload) that's pretty bulletproof when uploading files of any size, but I know squat about jQuery and all the demos pretty much just throw a bunch of files in a single bucket and don't seem to support any per file annotations or other form-type data.

Given my lack of jQuery experience, it's going to be a major hassle to even figure out whether I can adapt that jQuery engine for my purposes.

Can someone suggest either a robust, falut-tolerant PHP uploading class that I can use with my present code, or more modern Javascript/jQuery/Ajax/Whatever method that lends itself to my multi-file-with-extra-data requirements?

RE: Need a modern, robust file uploader, multiple files with text fields

Php doesn't upload. It is server side only. It will take whatever the browser gives the webserver and the webserver is allowed to take.

If you are on shared hosting then there may be webserver limits that prevent you getting files. Equally there are parameters within php that limit what you can receive. Many of these musr be set in php.ini rather than at runtime which may prevent you having control over them. Setting browser side directives will have no unlimiting effect on server side constraints of course.

So whatever upload interface you use your receiving system must be configured to handle it. All php (post) receiving scripts ultimately use the same mechanism.

RE: Need a modern, robust file uploader, multiple files with text fields

Thanks, jpadie. I do have access to php.ini for my domains and that's where I'm setting upload_max_filesize, it's just that larger files are kind of hit or miss.

I couldn't push a 119mb file through our uploader yesterday in five different attempts, today it uploads without incident. When it's failed, it hasn't given a reason.

I guess I'll just keep plugging...

RE: Need a modern, robust file uploader, multiple files with text fields

you need to set not just the upload max file size but also the post_max_size (should be greater than upload_max_filesize. you should also ensure that the php memory allocation is sufficient for large files.

try logging all file interaction as well. in your fileupload receiver just add the following


if(isset($_FILES) && count($_FILES) > 0):
 file_put_contents('filelog.txt', print_r($_FILES, true), FILE_APPEND);

if the php process doesn't have create privileges you may need to create the filelog.txt first.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close