admin wrote:
I have a PHP front end with a MySQL back end with a longblob field.

Okay?


I am thinking the problem exists in the PHP part.

Probably not.


Here is the code I am using:

$fileHandle = fopen($fileUpload, "r");
$fileContent = fread($fileHandle, $fileUpload_size);
$fileContent = addslashes($fileContent);

Then it goes into the Db connection part.

When I run the script I get the following error:

Warning: fopen("C:\\00000-temp\\100_0078.jpg", "r") -No such file or
directory in /var/www/testbed/httpdocs/blob/grabfile.php on line 41

Pretty self explanatory.


Warning Supplied argument is not a valid File-Handle resource in
/var/www/testbed/httpdocs/blob/grabfile.php on line 45

Direct result of the first error.


Then only thing that really jumps out at me in the file source path of
C:\\00000-temp\\100_0078.jpg  there is a couple of extra Backslashes (\)
in the path statement.

This really should be quite obvious. First, looks as if your script is running on a *nix box, yet you're trying to open a file using a Windoze directory structure. I'm going to say that this won't work. Two, it looks as if you're trying to read in an image...binary file...to enter it into a blob field in MySQL, so why are you going to 'addslashes()' to it"? Third.....well, I won't open that can of worms about storing your images in the DB....


I am using a sample script that pulled from one of the websites.

You need to modify the script to fit your environment.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to