First of all, apologies if I've posted this in the incorrect place. I wasn't too sure whether it was here or Theory and Design which would be most apt for my problem.
I've created an image upload form which base64 encodes the image, and then stores the base value in a SQL database. The image can then be referenced directly from a PHP script which decodes the base64, and sends the relevant HTTP header.
However, when uploading large files, the script doesn't work.
The database field size is sufficient, and it isn't cutting off the end of the image, it just seems to be failing to insert the row.
The image is being sent via post (obviously) and being encoded in the same script that includes it to the database, so url and http limitations aren't an issue.
Is there any notable limitation that would prevent large images being uploaded? I'm sure I've missed something obvious somewhere.
Thanks for the help ^_^
An odd error with an image upload script.
Moderator: General Moderators
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: An odd error with an image upload script.
Hitting the script max execution time or max upload file size?
Re: An odd error with an image upload script.
The max upload file size is 20mb, I was encountering issues at 1mb.
Script execution time is 30 seconds, and it finishes executing within that time. Specifically, it feeds back saying that it has uploaded and that the ID is 0 (meaning it clearly hasn't added the record).
Script execution time is 30 seconds, and it finishes executing within that time. Specifically, it feeds back saying that it has uploaded and that the ID is 0 (meaning it clearly hasn't added the record).
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: An odd error with an image upload script.
Interesting, and mysql isnt reporting any errors either?
I realize its a crude test, but I'll typically echo the query string and try running it manually through MySql query browser.
I realize its a crude test, but I'll typically echo the query string and try running it manually through MySql query browser.
Re: An odd error with an image upload script.
Ah, it would appear the issue is the max_allowed_packets limitation on SQL.
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: An odd error with an image upload script.
Thanks for sharing the solution! I'll file that one away in the gotcha's list 