Jump to content

Newb can't make simple upload work


Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/10710-newb-cant-make-simple-upload-work/
Share on other sites

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.