| | |
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
Views: 871 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for image, problem, subdomain, upload
ajax android api applet application array asp auto avg back basic bmp bug button byte c# c++ char* checkbox clone code codebox consumer cpu crash desktop directory disk display displayimageinsteadofflash downloader eclipse embedded error file files findcontrol form format formview free freeze ghost glitch google grid gui header hosting html image images java jpanel jpeg link listview loop method multimedia mysql packets php picture practice preview print problem producer profile random reading regqueryvalueex remove reputationmanagement screen script search searchbox speed sql sticky subdomain swf system textfield transfer udp update upload url vb.net vb2008 video vista wallpaper web webbrowser website working






