Need help with uploading.....

Reply

Join Date: Aug 2009
Posts: 2
Reputation: mynameis is an unknown quantity at this point 
Solved Threads: 0
mynameis mynameis is offline Offline
Newbie Poster

Need help with uploading.....

 
0
  #1
Aug 15th, 2009
I have an uploading script but i don't know what is the problem it always gives "Error". Here is the script
<?php
include ("include/session.php");
$username = $session->username;

if ($_REQUEST[completed] == 1) {
$newname = $username . ".gif";
move_uploaded_file($_FILE['mailfile']['tmp_name'], "./$newname") or die("Error");
}
?>
<?php if ($_REQUEST[completed] != 1) { ?><b>Please upload an image</b>
<br />

<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1500000"> <input type="hidden" name="completed" value="1"> Choose file to send: <input type="file" name="mailfile"><br /><input type="submit" value="Upload">
</form>

<?php

} else {

?>

<b>File Uploaded</b>

<?php

}

?>
Please help me........
Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 150
Reputation: sDJh is an unknown quantity at this point 
Solved Threads: 13
sDJh sDJh is offline Offline
Junior Poster

Re: Need help with uploading.....

 
0
  #2
Aug 15th, 2009
Check if the webserver has permission to write to your tmp- and your destination-folder. This is the only thing I can think of right now.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC