ckennerdale
Programmer
ok, I am trying to take a file off my hard drive and stroe inside a mysql database.
The following line allows me to do this-
$imagedata = addslashes(fread(fopen($userfile, "r", filesize($userfile)));
($imagedata is the file I have selected from my hard drive)
Now on my 'add' function everything is ok but on my edit page where I anr to 'update' my filed the code seems to fail at the fopen stage.
With the following code (for troubleshooting purposes)-
($nu_userfile = is the result of my form)
echo $nu_userfile";
$imagedata2 = fopen($nu_userfile, "r"
if(!$imagedata2 ) die ("cannot open file"
I get this response
C:\\delete.gif
cannot open file
whoich I do not understand- the variable is obvioult parsing from my form- C://delete.gif, but why does it fail at fopen?
As I say fopen works elsewhere, any ideas??? Caspar Kennerdale
Senior Media Developer
The following line allows me to do this-
$imagedata = addslashes(fread(fopen($userfile, "r", filesize($userfile)));
($imagedata is the file I have selected from my hard drive)
Now on my 'add' function everything is ok but on my edit page where I anr to 'update' my filed the code seems to fail at the fopen stage.
With the following code (for troubleshooting purposes)-
($nu_userfile = is the result of my form)
echo $nu_userfile";
$imagedata2 = fopen($nu_userfile, "r"
if(!$imagedata2 ) die ("cannot open file"
I get this response
C:\\delete.gif
cannot open file
whoich I do not understand- the variable is obvioult parsing from my form- C://delete.gif, but why does it fail at fopen?
As I say fopen works elsewhere, any ideas??? Caspar Kennerdale
Senior Media Developer