Image Upload
Posted: Thu Sep 05, 2002 8:03 am
I'm trying up upload images to a folder on the server.
I'm using the code/tutorial I found on zend.com
http://www.zend.com/zend/spotlight/uploading.php
My problem is that the image gets loaded to the temporary folder, and is given a temporary name, but it doesn't get stored in it's permanent place.
I've tried changing the destination path name several times, but each time I get a message saying that the image wasn't stored.
Here's my code:
Any help would be greatly apprecaited.
Thanks
I'm using the code/tutorial I found on zend.com
http://www.zend.com/zend/spotlight/uploading.php
My problem is that the image gets loaded to the temporary folder, and is given a temporary name, but it doesn't get stored in it's permanent place.
I've tried changing the destination path name several times, but each time I get a message saying that the image wasn't stored.
Here's my code:
Code: Select all
<?
$uploadpath = '/path/to/temp/folder/on/the/server/www/';
$source = $HTTP_POST_FILESї'file1']ї'tmp_name'];
$dest = '/path/to/server/www/images/';
if ( $dest != '' ) {
if ( move_uploaded_file( $source, $dest ) ) {
echo 'File successfully stored.<BR>';
} else {
echo 'File could not be stored.<BR>';
}
}
}Thanks