Jump to content

Uploading same image from tmp directory


qwerty234

Recommended Posts

I have pasted my code below. I want to place the user's uploaded image in /tmp/latest.img, but for some reason it is always uploading the same file even though I'm using fopen with the "wb" permission set and fclose. Does anyone have any ideas?

 

        move_uploaded_file($_FILES['imagefile']['tmp_name'],"/tmp/latest.img");
        $instr = fopen("/tmp/latest.img","wb");
        $image = addslashes(fread($instr,filesize("/tmp/latest.img")));

        if (strlen($instr) < 20000) {
                $validImageSize = true;
        } else {
                $validImageSize = false;
        }

        fclose($instr);

Link to comment
https://forums.phpfreaks.com/topic/79581-uploading-same-image-from-tmp-directory/
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.