Jump to content

Recommended Posts

Hello there,

I built a Flash app a few years ago that was used in a CMS to upload files to the local filesystem. It is using a php script which includes this:

 

$ext = explode('.',strtolower($_FILES['Filedata']['name']));
$ext = ".".$ext[count($ext)-1];

$a1 = move_uploaded_file($_FILES['Filedata']['tmp_name'], $path.$id.$ext); // $path and $id are being passed from the flash file
$a2 = chmod($path.$id.$ext, 0777);

 

It's been working fine for all this time, however something has changed recently on the server and it has stopped working. The Flash file takes the file and goes through the motions of uploading, and doesn't return any errors, except that when I go to the folder the file just isn't there.

 

So I got the php file to mail me whenever it got processed:

 

path = ../../_res_dropbox/website/_mediafiles/
id = 100
ext = .swf
_FILES['Filedata']['name'] = Zambia.swf
_FILES['Filedata']['tmp_name'] = 

 

So it turns out that $_FILES['Filedata']['tmp_name'] is empty...

 

In fact the server returns this

PHP Warning:  chmod() [<a href='function.chmod'>function.chmod</a>]: No such file or directory in /var/www/vhosts/redearthstudio.com/httpdocs/client/website/uploadScript.php on line 13

(line 13 is the 'tmp_name' line)

 

Does anyone know why this might be happening, all of a sudden and out of the blue?

 

This website has been out of my hands for a while, so I don't know what has changed on the server over the past few months... possibly upgrading from php4 to 5?

 

Many thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/259765-upload-script-stopped-working-suddenly/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.