Announcement

Collapse
No announcement yet.

Another quest about image upload

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Another quest about image upload

    let's assume i made something like this:

    echo "<form method=post action='temp.php3' enctype='multipart/form-data'>";
    echo "<input type=file name=file>";
    echo "<input type=submit value='Upload'>
    echo "</form>";

    Now php makes a tmp file of it in this form -> var/tmp//php003665 Now i want to upload it via a function, but that doesn't work, but if i don't put the code in a function it works fine, can anyone tell me how to do the upload in a function or why it won't work in a function?

    By the way, this is my upload script

    $bron = fopen($source,"r");
    $contents = fread($bron,$source_size);
    fclose($bron);
    $dest = fopen("ftp","wb");
    fwrite($dest,$contents,$source_size);
    fclose($dest);
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X