| | |
Image upload problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 6
Reputation:
Solved Threads: 0
Hi buddy,
I have small script which upload the images. This script is working perfectly fine in
localhost but when I upload that script to my website then it is not uploading the pictures.
I have subdomain in my website names as http://projects.abc.com,
In projects folder I have my photo upload script.
Here I add some code from my file.
If you have some sort of solution then please help me.
Thanks for read my post!
I have small script which upload the images. This script is working perfectly fine in
localhost but when I upload that script to my website then it is not uploading the pictures.
I have subdomain in my website names as http://projects.abc.com,
In projects folder I have my photo upload script.
Here I add some code from my file.
PHP Syntax (Toggle Plain Text)
$numfilesuploaded = $_POST['numuploads']; $count = 1; while ($count <= $numfilesuploaded) { $conname = "new_file".$count; $filetype = $_FILES[$conname]['type']; $filename = $_FILES[$conname]['name']; if ($filename != '') { if ($filetype == "image/x-png" || $filetype == "image/pjpeg" || $filetype == "image/gif" || $filetype == "image/jpeg") { $maxfilesize = $_POST['maxsize']; $filesize = $_FILES[$conname]['size']; if($filesize <= $maxfilesize ) { $randomdigit = rand(0000,9999); $newfilename = $randomdigit.$filename; $source = $_FILES[$conname]['tmp_name']; $target = "upload/project/".$newfilename; move_uploaded_file($source, $target); $sql_update = "UPDATE project SET photo".$count." = '".$newfilename."', modified_date = now() WHERE project_id = '".$str_project_id."' "; tep_db_query($sql_update, $conn); } else { echo $count." File is too big! 10MB limit! |"; } } else { echo " The file is not a supported type |"; } } $count = $count + 1; }
If you have some sort of solution then please help me.
Thanks for read my post!
•
•
Join Date: Sep 2009
Posts: 6
Reputation:
Solved Threads: 0
When I echo that target path it show me the full path like this,
http://projects.abc.com/upload/project/image-name, and that update query run successfully and add the new name of the image in database but no photo uploaded in the desire location.
http://projects.abc.com/upload/project/image-name, and that update query run successfully and add the new name of the image in database but no photo uploaded in the desire location.
Last edited by Jeyush; Oct 2nd, 2009 at 1:37 am.
![]() |
Similar Threads
- Help with PHP Image Upload? (PHP)
- Help needed with image upload script (PHP)
- Image upload from, Form into Folder and MySQL (PHP)
- Image upload, Thumbnail creation and more (PHP)
- image upload problem (PHP)
- HELP - Image Upload (PHP)
- bar image reset problem (Pascal and Delphi)
Other Threads in the PHP Forum
- Previous Thread: Delete XML nodes failing...
- Next Thread: Time Format AM PM
| Thread Tools | Search this Thread |
ajax android animation api applet array assignment auto avg back backup box broken browser bug bugs button buttons byte c# c++ char* clone cloning code codebox crash daniweb database disk display displayimageinsteadofflash drive error file files findcontrol flash form freeze ghost glitch gui header hosting html image images insert java javascript jpanel link listview loop mediawiki method mosaic multimedia mysql newbie panel php picture picturebox practice preview problem processor programming random reading regqueryvalueex repositories reputationmanagement screen script search searchbox shot speed sql sticky stop subdomain swf swf. swing textbox textfield threads transfer update upload url video virus web website working






