altrock182182
New Member
- Messages
- 40
- Reaction score
- 0
- Points
- 0
I have an upload script that I'm using in a private area of my website. I'm looking to get a jpg, gif, or bmp loaded into a blob element in my database.
I'm having trouble saving the file somewhere that it can be accessed. I'm not accustomed to unix directory listings or remote hosts..
How would I go about moving an uploaded file to a permanent directory? I have something like this so far:
I'm having trouble saving the file somewhere that it can be accessed. I'm not accustomed to unix directory listings or remote hosts..
How would I go about moving an uploaded file to a permanent directory? I have something like this so far:
PHP:
$dbpicfile='/home/---/public_html/---/images/cars/'.basename($_FILES['file']['name']);
/*I'm assuming the above line is terribly, terribly wrong! */
move_uploaded_file($_FILES['file']['tmp_name'],$dbpicfile);
$query = "INSERT INTO ".$mysql_db."(`CARID`,`THUMBOF`,`PICDATA`)
VALUES ('$carid',NULL,LOAD_FILE('$dbpicfile'))";
$imginsert = mysql_query($query);
Last edited: