Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Couldn't upload image to MYSQL. safe mode=on

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello buddies,I've finally found a good site which offers:

PHP v4.1.0, including essential libraries and extensions like GD,ZLIB,PDF and more!
MySQL
MySQL Admin
Web-based upload features
50 Megs of disk space
unlimited bandwidth

Something you might want to know: it's bannerless.

Meanwhile I got in trouble dealing with upload issue. Okay,I am going to let the users to upload their favourite images,then storing them into MySQL database Somehow the script that originally works on my pc became useless when I uploaded it to mysite.
Here you go:
....
....
$img = addslashes(fread(fopen($pic, "r"), filesize($pic)));
.....//perform query to insert $img into mysql database...
...........
..........

My understanding is that: the above codes will open the temporary directory contains $pic,then read and store it into MySQL. Basically I didn't get any error or warning message, but I saw nothing when executing the script hosted at tripod uk.I did check the table in mysql and it just showed 0 for the image size. I guess php couldn't recognize where the temporary path is. My phpinfo at
shows that the upload_temp_dir is ./ and the safe mode is on. Is it because of safe mode restriction?Could anyone please help me figure out why?I really appreciate your helps and suggestions.Thank you very much.

jimcurry@hotpop.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top