server offers the .php as download

See all posts Reply

server offers the .php as download new!
by Bo, 18 years, 3 months ago
When submitting an image my browser shows me a download window in which the file is offered that actually should handle the file transformation/uploadReply
Re: server offers the .php as download new!
by colin, 18 years, 3 months ago
This has nothing to do with the class I'm afraid. Your file is simply not executable (try chmod 755), or your server not set to serve PHP pages.Reply
Re: server offers the .php as download new!
by Boris, 18 years, 3 months ago
but if i use

if ($MyObject->uploaded) {
   $MyObject->file_new_name_body = $photo_name;
   die($MyObject->log);
   $MyObject->process($dir_big);
etc...

it does die with the log! When I place the "die" after the ->process, it offers the file as download!

it diesReply
Re: server offers the .php as download new!
by colin, 18 years, 3 months ago
I admit it is strange, but it must be a server issue. Are you sure that all the files, including the class are chmod' to 755?Reply
Re: server offers the .php as download new!
by Boris, 18 years, 3 months ago
I've modded all files to 777 (php file that uses class & class file), no effect unfortunataly.Reply
Re: server offers the .php as download new!
by Boris, 18 years, 3 months ago
btw... the file that is offered for download has the same name as the .php that arranges for the upload using your class. When i download the file it is empty, also when i put some fake html into the file. Very strange, haven't seen anything like it! Looks almost like the class is making the server present a file to the webclient.Reply
Re: server offers the .php as download new!
by colin, 18 years, 3 months ago
I can't really offer much help here. As I said, it is almost certainly a server issue, not a class issue.Reply
Re: server offers the .php as download new!
by Boris, 18 years, 2 months ago
I traced the problem to the next function:

function recursiveMkdir($strPath, $mode = 0777) {
  return is_dir($strPath) or ( recursiveMkdir(dirname($strPath), $mode) and @mkdir($strPath, $mode) );
}

any ideas on reasons for the problem?Reply
Re: server offers the .php as download new!
by colin, 18 years, 2 months ago
What do you mean you traced the problem to the function? What do it do?

Are you using PHP5? Do you attempt to create sub directories, or is the directory already existing?Reply