igarrett Posted February 3, 2008 Share Posted February 3, 2008 Alright, I've been trying to figure something out for a while now, and it's gone beyond me. I have a basic upload script for a user on their website that builds a list of links to the uploaded files on their website. It's basic. It puts the file in a directory. Thats all, however they can't get it to work. I can't get it to not work. I've tried on Mac and PC, Opera, Safari, IE, FF and so on and I can't find another instance of this happening. I can't imagine what the user error would be, because it's just pushing a button. PHP 5.2.5, hosted by bluehost, no error message. I have it echoing a message with a link to the file afterwards, for the user, the link doesn't include the file name. has anyone known this to happen or have any ideas as to why one person (who says they've tried it on multiple computers) wouldn't be able to upload a file with a standard script? Quote Link to comment https://forums.phpfreaks.com/topic/89160-bizarre-upload-issue/ Share on other sites More sharing options...
ratcateme Posted February 3, 2008 Share Posted February 3, 2008 can we see some code to help us find your problem Scott. Quote Link to comment https://forums.phpfreaks.com/topic/89160-bizarre-upload-issue/#findComment-456575 Share on other sites More sharing options...
igarrett Posted February 3, 2008 Author Share Posted February 3, 2008 sure thing here is the form: <html> <body><BODY bgcolor="efefad"> <font face="Courier New, Courier, mono" size="4"><b>Step 1 of 3: UPLOAD FILE</b><br><br><form action="http://www.website.com/uploadreelfile.php" method="post" enctype="multipart/form-data"> <label for="file">Movie File:</label> <input type="file" name="file" id="file" /> <br /></BR></BR> <input type="submit" name="submit" value="Submit" /> </font> </form> here is the php <?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("files/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "reelfiles/" . $_FILES["file"]["name"]); echo "<br><br>"; echo "<b><font size=5>File Address:</font></b> "; echo "<br><br> <textarea cols='100' readonly='0'>"; echo "http://www.website.com/reelfiles/" . $_FILES["file"]["name"]; echo "</textarea>"; echo "<br><br>"; echo "<b>Copy This address to use link</b>"; } } As I mentioned, I can't get it to not work. It's hard to troubleshoot a problem one can't recreate, so as far as I can tell it works. The client can't get it work though. THey are the only person that uses it, so thats a problem. When they get to the second page it doesn't give an error message, it just has blank info, no file size, the echoed file path doesn't have a file name, and when I look for the file on the server nothign has been uploaded. When I use it, this all works fine. ideas? Quote Link to comment https://forums.phpfreaks.com/topic/89160-bizarre-upload-issue/#findComment-457002 Share on other sites More sharing options...
ratcateme Posted February 3, 2008 Share Posted February 3, 2008 try modifying your move_uploaded_file to include the full file name move_uploaded_file($_FILES["file"]["tmp_name"], dirname(__FILE__)."reelfiles/" . $_FILES["file"]["name"]); i had a similar problem and that fixed it Scott. Quote Link to comment https://forums.phpfreaks.com/topic/89160-bizarre-upload-issue/#findComment-457025 Share on other sites More sharing options...
igarrett Posted February 3, 2008 Author Share Posted February 3, 2008 thanks for the tip. I'm waiting for the client to try it, but it does still work for me so I know it's not like i messed up the existing process I'll post again and close out the thread as I have more info! Quote Link to comment https://forums.phpfreaks.com/topic/89160-bizarre-upload-issue/#findComment-457041 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.