Jump to content

Sophisticated PHP Upload File Form


pakenney38

Recommended Posts

I am interested in creating an file upload form for people where I work to upload PDF files and the like. Previous attempts have left me frustrated as I can only get about 5-6MB files uploaded in one form submit before there is an error of some sort.

Has anyone seen any good examples/books on how to create this?

Another idea I had involved:
1. The user types in a title for their file
2. The user uploads the file with the form
3. PHP processes the title, turns it into a bullet text on the web site and links the text to the uploaded file automatically using a MySQL reference.
Link to comment
Share on other sites

Everything is possible that you want to do except one, The file size. If you are using a web hosting company you have to find out what they have the cgi_timeout and the max_execution_time set at. php scripts can only run as long as these variables allow. the type of connection will determine the size file you can upload.

Ray
Link to comment
Share on other sites

So is there some alternative technology you would suggest, or any direction at all?
When working on an older upload project, I eventually scrapped it, because I had increased cgi_timeout and the max_execution_time on my Apache server in different increments along with trying some other settings and never got more than 5-6MB uploaded before the browser gave an error.
Link to comment
Share on other sites

if you are unable to edit the php.ini file on your web host, you can put a local copy, with just the modifications you wish to make, in the root folder of your web host.
I had the same trouble as you, so changed my local php.ini to read:
[code]upload_max_filesize = 10M
post_max_size = 11M
max_execution_time = 300[/code]

upload_max_filesize does what it says on the tin.
post_max_size specifies the maximum size a POST can be (slightly larger than max_file_upload to account for any overheads or other fields)
max_execution_time is the amount of time each script is given to run, you have to take into account the upload speed and filesize when working this out.

Some webhosts may not be too happy with you doing this though, as they normally create php.ini for maximum performance among all their hosted domains. I suppose if they contact you about it, then you'll have to cease and desist.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.