File Upload problem


kleeh
Asked:
2012-03-28 9:46 pm EST

Hits: 943
My site allows certain types of document uploads, which usually work fine until the document size gets large. It seems to vary by type but generally if they get around 1.5 or 2 Meg, it fails and spews the actual binary file contents on the screen. Of course I've checked the php.ini to see what the upload_max_filesize is and it's set at 256 Meg (not that I'd ever allow them to upload one that big). So does anyone have any idea what other things I need to check? I don't see any errors in the log files pertaining to this. Let me clarify that I'm inserting these documents into a blob field on a database and not in a folder -- if that matters.

Ok, I'm having to post my followup question here because your site keeps asking me to "post your text in the comment section" even though I've done that. So I got root access. But it doesn't do me much good if I can't add the max_allowed_packet change, or any other change, to the my.cnf file. I can't "sudo" because I'm not in the "sudoers" file and I can't chmod because I don't have permissions to do that either. Catch-22. So what do I do? Can someone just change my max_allowed_packet to 32M ? Thanks

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

Tim S.
Staff
9,967 Points
2012-03-29 9:10 am EST
Hi kleeh,

Thanks for posting your question. I'm sorry you're having issues with storing the uploaded files in a database. I'm more than happy to assist you.

Basically, when you store a file in a blob, it converts the file to binary and stores the binary code in the field in the database. Since it is stored as one large packet you'll need to check your max_allowed_packet in the /etc/my.cnf

Here's the code snippet to look for and change:

max_allowed_packet=16M



You can change this setting to whatever you'd like to set the max packet size. Keep in mind, you'll need root access to edit the my.cnf file. If you do not have root access and wish to gain it please see our article on "Gaining Root Access".

If you do not wish to have root access, you can submit an email request to have the setting changed. If you request us to change the setting via an email to support@inmotionhosting.com please be sure to verify your email by providing the last four digits of the credit card on file or the current AMP password.

If you need further assistance please feel free to contact us.

Thanks!

Tim S

You must login before you can post a comment about this answer.

Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!