jeeves245 Posted August 10, 2009 Share Posted August 10, 2009 Hey all, another question (I know I know, i'm full of questions). Having some problems uploading a file to my server. I have no issues on my local Apache server, but when I saved the files to my web host's FTP server I get the following errors: Warning: move_uploaded_file(http://www.example.co.nz/folder/uploads/deliveries.csv): failed to open stream: HTTP wrapper does not support writeable connections. in /var/www/html/folder/uploader.php on line 6 Warning: move_uploaded_file(): Unable to move '/tmp/phpxmrk5L' to 'http://www.example.co.nz/folder/uploads/deliveries.csv' in /var/www/html/folder/uploader.php on line 6 Here is the form code: <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose manifest from computer:<br> <input name="uploadedfile" type="file" /><br /><br> <input type="submit" value="Click here to upload" /> And here is the actual code that handles it (uploader.php): <?php $target_path = "http://www.example.co.nz/folder/uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { //more code here but it doesn't related to the errors ?> This code should uploaded the file to the /uploads folder. As I said, it worked fine on my local server, just not on my web host. Any ideas appreciated Link to comment https://forums.phpfreaks.com/topic/169523-solved-file-upload-errors/ Share on other sites More sharing options...
kirisutegomen Posted August 10, 2009 Share Posted August 10, 2009 <?php $target_path = "./uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { //more code here but it doesn't related to the errors ?> try that Link to comment https://forums.phpfreaks.com/topic/169523-solved-file-upload-errors/#findComment-894458 Share on other sites More sharing options...
jeeves245 Posted August 10, 2009 Author Share Posted August 10, 2009 I think that did it. Thanks Link to comment https://forums.phpfreaks.com/topic/169523-solved-file-upload-errors/#findComment-894462 Share on other sites More sharing options...
kirisutegomen Posted August 10, 2009 Share Posted August 10, 2009 np Link to comment https://forums.phpfreaks.com/topic/169523-solved-file-upload-errors/#findComment-894467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.