Jump to content

What is this error?


JJohnsenDK

Recommended Posts

Hey

[code]<?php
    include ('../mysql_connect.php');
?>
<?php

if (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

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.