JJohnsenDK Posted November 14, 2006 Share Posted November 14, 2006 Hey[code]<?php include ('../mysql_connect.php');?><?phpif (isset($_FILES['filnavn'])) { print "Fil, der er blevet overført: {$_FILES['filnavn']['name']}<p>\n"; $query = "INSERT INTO billeder SET billednavn ='".$_FILES['filnavn']['name']."'"; $Result1 = mysql_query($query) or die (mysql_error());}{ $tempfile = $_FILES['filnavn']['tmp_name']; $destination = "billeder/{$_FILES['filnavn']['name']}"; copy($tempfile, destination);}?><form action="uploadtest.php" method="post" enctype="multipart/form-data" name="form1"> <p> Fil, der skal overføres: <input name="filnavn" type="file" id="filnavn" /> </p> <p> <input type="submit" name="Submit" value="Overfør" /> </p></form>[/code]The script i made here should upload a picture/file to the a folder called [i]billeder[/i] this works fine on my localhost server, but when i try it on my webhotel server it shows this error:[i]Warning: Unable to open '' for reading: No such file or directory in /virtual/www/www.lenep-katrinelund.dk/sider/uploadtest.php on line 26[/i]line 26 is this piece of code:[i]copy($tempfile, destination);[/i]I allready gave all access to this folder, so i dont understand the error/warning php gives me.Hope someone can help. Link to comment https://forums.phpfreaks.com/topic/27196-what-is-this-error/ Share on other sites More sharing options...
printf Posted November 14, 2006 Share Posted November 14, 2006 Hi...Change....[code] copy($tempfile, destination);[/code]to... (missing [$] before destination), also use move_upload_file() instead of copy().[code] move_upload_file ( $tempfile, $destination );[/code] Link to comment https://forums.phpfreaks.com/topic/27196-what-is-this-error/#findComment-124414 Share on other sites More sharing options...
JJohnsenDK Posted November 15, 2006 Author Share Posted November 15, 2006 Super that works! thanks alot mate.PS. how do i mark this thread/post RESOLVED? Link to comment https://forums.phpfreaks.com/topic/27196-what-is-this-error/#findComment-125051 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.