Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to upload files but get an Error

Status
Not open for further replies.

Qwark

Programmer
Sep 26, 2000
59
0
0
NL
I have made the next code, the first time i run the script i'll get an error (I know, doesn't matter at this time).
When i have choose a file on my harddisk (I use Windows 95)
And click on the button upload i get the next error:

Warning: Unable to open 'C:\\files\\0013-0007-1.jpg' for reading: No such file or directory in /var/ on line 7


--- CODE START HERE ---
<HTML>
<HEAD><TITLE>Title</TITLE></HEAD>

<BODY>
<?php

if(copy($img1, '/var/{
echo(&quot;Succesvol upgeload&quot;);
}
echo(&quot;name: $img1_name <P>&quot;);
echo(&quot;mime type: $img1_type&quot;);
?>
<FORM enctype=&quot;multipart/form-data&quot; methode=&quot;POST&quot; action=&quot;upload.php&quot;>
<INPUT type=&quot;hidden&quot; name=&quot;MAX_FILE_SIZE&quot; value=&quot;99000&quot;>
<INPUT type=&quot;file&quot; name=&quot;img1&quot; size=&quot;25&quot;>
<INPUT type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;upload&quot;>
</FORM>

</BODY>

</HTML>
--- CODE ENDS HERE ---

What do I wrong, please help me,

Qwark
 
Well, number 1 ... we cannot tell anything from this because this is not the file doing the uploading ... upload.php is what we need to see also.

And , number 2 ... you spelled method as ... methode ... in your form ... maybe this is a typo in this message and not on your actual code so it may not be a problem.

Anyway ... show us the upload.php.

Don
dond@csrinc.com

 
I'll hope your are right with method / methode. This is the upload.php file. As I sad by first viewing this page i'll get an know error. But that is not a problem. Sorry but i am very new in PHP. But I know it is possible to post to the same page, because I 've done that before. I have this code from a turtorial.

By the way if there is someone who see an other error post it.

But thanks a lot,

Qwark
 
Change your code as given bellow

if(copy($img1, 'c:\\apache\\htdocs\\test\\picture\\image1.jpg'))

it should work if not mail me at

tabish@indya.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top