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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.