bilgehanyildirim
asked on
php fputs iis 6.0
Hi there,
When I run the following code on linux/apache server, it correctly creates the file. But when I run it on Windows 2003 IIS 6.0, it still creates the file but they are not valid picture files.
Is there something else I need to do to be able to run this on IIS ?
PS : $campaign['Campaign']['pic ture'] is a BLOB field in mysql database.
When I run the following code on linux/apache server, it correctly creates the file. But when I run it on Windows 2003 IIS 6.0, it still creates the file but they are not valid picture files.
Is there something else I need to do to be able to run this on IIS ?
PS : $campaign['Campaign']['pic
$absDir = WWW_ROOT . 'img' . DS . 'campaign' . DS;
$filename = $absDir.$id'.jpg';
$fp = fopen($filename,"w+");
fputs($fp, $campaign['Campaign']['picture']);
fclose($fp);
ASKER
No no error. Site is creating the file in the correct location. But when I double click on it, it says (on windows) no preview available.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still same, no preview available
ASKER
actually the file created on linux/apache is 13.6 KB, but the file create on IIS is 8.1 KB. Even though I made the changes you mentioned above.
I am attaching the file that doesn't work
63.jpg
I am attaching the file that doesn't work
63.jpg
ASKER
It has nothing to the with PHP or IIS, it was mysql error.
Thanks for the tip though.
Thanks for the tip though.
Is the "$absDir" variable pointing to the right location? Moving from Linux to Windows will also change your path structure.