Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fopen woes!

Status
Not open for further replies.

ckennerdale

Programmer
Dec 23, 2000
158
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top