Jump to content


Photo

Newb can't make simple upload work


  • Please log in to reply
1 reply to this topic

#1 mark@focuspublicationsgro

mark@focuspublicationsgro
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 29 May 2006 - 03:37 PM

Hi,

I have a simple upload script that I can't seem to make work. I don't know much about php but have managed to make a secure login in the past with the help of a book, but this is stumping me.
I have my form script in a java pop up, which calls the script below when submitted. Everytime I try to submit a file (even a tiny text file) I get the error 'No Input file specified'. I know this error isn't coming from 'php' but from the script below as I've changed the error wording in the script and the error changes with it.

I don't know if I am making mistakes in the path to where I want the file copied to or whether it's a permission thing (windows box - upload folder is shared)

Do I need to set the doc_root in the php.ini file?

Thanks for any help!!
<?

if ($our_file != "") {

copy($our_file, "\proofs\$our_file_name") or die("Couldn't Upload the file!");
//This is for windows based computers it will store the file in c:\inetpub\wwwroot\mybuddy\upload
} else {

die("No input file specified");
}

?>
<html>
<head>
<title>Successful File Upload!</title>
<body><font face=verdana size=2>

<B>Success!</B>

<P>You sent: <? echo "$our_file_name"; ?>, a <? echo "$our_file_size"; ?>
byte file with a mime type of <? echo "$our_file_type"; ?>.
</p>

</font></body>
</html>



#2 Ferenc

Ferenc
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 29 May 2006 - 03:45 PM

if you you use php to process the upload.

is_uploaded_file -- Tells whether the file was uploaded via HTTP POST
move_uploaded_file -- Moves an uploaded file to a new location.

these should help, see [a href=\"http://us3.php.net/manual/en/features.file-upload.php\" target=\"_blank\"]handling file uploads[/a]
Everything you want to know is here.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users