Chips Posted July 5, 2006 Share Posted July 5, 2006 The code is near identical to that of php.net's example... and it WORKS under linux/apache servers. However, I am trying to get the darned thing working upon WINDOWS IIS instead, which is giving problems. So it works on one platform, but not on another. Essentially the question is, does anyone know why? Sessions can be written to the local temp folder of the windows server, so I would have assumed that it's okay to upload files to that location as well (only admins can upload files, and at this moment- security isn't an issue, tis a local server for local people... no strangers on here!).[code]<table width="100%" class="padded"> <tr height="140"> <td align="center"> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="11111111" /> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> Choose a file to upload: </td> <td rowspan="2"> <input name="userfile" type="file" /> </td> </tr> <tr> <td><span class="small">(max filesize is 1111111)</span> </td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="submit" name="submit"/> </td> </tr> </table> </form> </td> </tr> </table>[/code]Uploader.php [code]// Where the file is going to be placed$target_path = '';/* Add the original filename to our target path. Result is "uploads/filename.extension" */$target_path = $target_path . basename($_FILES['userfile']['name']);echo $target_path;if(move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['userfile']['name']). " has been uploaded";} else{ echo $_FILES['userfile']['error'] ." - error uploading the file, please try again!"; print_r($_FILES);}?>[/code]Any input or suggestions would be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/13733-http-file-uploads/ Share on other sites More sharing options...
DaveLinger Posted July 5, 2006 Share Posted July 5, 2006 I believe for the path under windows you have to include the full thing, including drive name... like mine was "E:/something/something/something/users/d/l/i/n/g/e/r/www/upload/" Quote Link to comment https://forums.phpfreaks.com/topic/13733-http-file-uploads/#findComment-53321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.