Storing Images In MySQL
Article Comments (31 total)
I have uploaded this exact code onto Startlogic's Appache server and still can't get the image file to upload. ("Please submit a file" error) Startlogic tells me the $_server['PHP_SELF'] is the currently executing script. Please advise -- I have been struggling with this for some time. Thanks in Advance Steve
Just to point out a common usage of this technique ... banks storing scanned versions of checks to be shown in online backing UI's. For img galleries, blogs etc it is best to store the file in a traditional manner. Most virtual hosting providers limit db storage and resources. Knowing your environment, resource limits and user base will greatly aid in your decision.
I'm getting the following errors after running listing-5.php : Warning: Unexpected character in input: '\' (ASCII=92) state=1 (line 2) and Parse error: syntax error, unexpected T_STRING (line 2) I've pasted the code directly. Could it be the naming of the function?
finally got it all to work, though there appear to be some errors in the code provided. thanks to other tips provided, i've finally got it. after much hunting around, this is the best simplest tutorial available, though not perfect.
at Richard@Home: Sorry, but "It's still a bad idea" for what kind of applications? My opinion: It's neither a good nor a bad idea, it simply can't be one of the both for general, the decision for one or the other depends on many things like: How big are the images, for what are they used and so on. Would you say that it's better to store many little PNG icons (eg 16x16) in file system? I don't think so... They are about 300 bytes.




I have to agree with Halfasix, this is a pretty ambiguous and poorly validated tutorial, pity as the layout and content is generally very good. its not evident how this series of scripts should be tied together, whether some should be consolidated in a single file or split amongst multiples, in spite of the naming format.