Re: Problem with uploading Files with PHP 4.1.2 on IIS

From: Date: Mon, 22 Apr 2002 17:28:46 +0000
Subject: Re: Problem with uploading Files with PHP 4.1.2 on IIS
References: 1 2 3 4  Groups: php.windows 
Request: Send a blank email to php-windows+get-13232@lists.php.net to get a copy of this message
Thank you Mike once more you are correct. One more thing. Now the file is saved in a Blob field at the database. But when I show the blob field the image doesn´t appear. Just a collection of characaters. I have to save the Blob field in a file. How can I do that? Thank you very much. ----- Original Message ----- From: "Mike Flynn" <mike@mikeflynn.net> To: "Waldemar Brand Neto" <wbn@softall.com.br> Sent: Monday, April 22, 2002 12:35 PM Subject: Re: [PHP-WIN] Problem with uploading Files with PHP 4.1.2 on IIS > Thanks :). > > You will definitely need the quotes around the $bindata in the > query. You're right that quotes within the binary data can mess up PHP or > MySQL. They won't mess up PHP in this case because they are contained > within a string variable ($bindata), and never directly parsed in the > code. But they could mess up MySQL in the query, where the single quotes > could confuse MySQL. > > However, in the code I gave you: > $thebindata = addslashes(fread(fopen($the_file, "r"), filesize($the_file))); > > You can see it uses the "addslashes" function to work around this > problem. Did you use the addslashes in your code on the $bindata before > the query? Addslashes adds backslashes (\) in front of single and double > quotes, which fixes it for MySQL. Are you using it? > > -Mike > > At 12:14 PM 4/22/2002 -0300, you wrote: > >Dear Myke you are a good programer with trained eyes to find the erros fast. > >I tried with quotes, without and but it not works. > >I Think the problem is the image itself. Inside the Image I have a several > >' and ". This quotes cause problem confusing php. I send an atached file > >with the result. Don´t worry the image is just a test. Do you have any idea? > > > >Thanks, Waldemar >

« previous php.windows (#13232) next »