russcrosbie2002
10-11-2002, 11:18 PM
I have a php script that writes binary (image) files posted from a html form to a mysql database.
if (!$prod_file) $prod_file = "..\images\warning.gif";
$prod_file = addslashes(fread(fopen($prod_file, "r"), filesize($prod_file)));
and writes a default file (warning.gif) when an image is not posted from the form page.
This works locally on my 'localhost' setup running the latest versions of PHP and MYSQL on IIS5.1. But when I upload the database and scripts to my ISP, whose phpinfo() parameters are set identically to mine (although they are running IIS4 with slightly older versions of PHP and MYSQL , i get an error when it tries to find and write the default file. Otherwise files that are posted as $prod_file are recognised and written to the db.
errors are as follows:
Warning: fopen("none","r") - No such file or directory in xyz
Warning: stat failed for none (errno=2 - No such file or directory) in xyz
Warning: Supplied argument is not a valid File-Handle resource in xyz.
The rest of the fields (varchar and so on) are written properly despite the error.
Could anyone suggest a solution cos I am at my wit's end and have 3 question marks hanging over my gradually balding cranium. All help gratefully recieved may lower my blood pressure!
:confused:
Regds
Russ.
if (!$prod_file) $prod_file = "..\images\warning.gif";
$prod_file = addslashes(fread(fopen($prod_file, "r"), filesize($prod_file)));
and writes a default file (warning.gif) when an image is not posted from the form page.
This works locally on my 'localhost' setup running the latest versions of PHP and MYSQL on IIS5.1. But when I upload the database and scripts to my ISP, whose phpinfo() parameters are set identically to mine (although they are running IIS4 with slightly older versions of PHP and MYSQL , i get an error when it tries to find and write the default file. Otherwise files that are posted as $prod_file are recognised and written to the db.
errors are as follows:
Warning: fopen("none","r") - No such file or directory in xyz
Warning: stat failed for none (errno=2 - No such file or directory) in xyz
Warning: Supplied argument is not a valid File-Handle resource in xyz.
The rest of the fields (varchar and so on) are written properly despite the error.
Could anyone suggest a solution cos I am at my wit's end and have 3 question marks hanging over my gradually balding cranium. All help gratefully recieved may lower my blood pressure!
:confused:
Regds
Russ.