Jump to content

jmolleur

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jmolleur's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I can load a blob field to a MySQL database, but I get a size restriction.  I use the following code:       $binFile = $uploadfile;       $imgLocation = str_replace("\\","/", $binFile);       $handle = fopen($binFile, "rb");       $data=addslashes(fread($handle, filesize($binFile)));       $strDescription = addslashes(nl2br($txtDescription));       mysql_connect($database, $username, $password);       @mysql_select_db($database) or die("Unable to select database");       $query="Update contacts set Tif_file='$data', email='test2', fname='$basefilename' where first = 'Alexa'";       if (mysql_query($query)) {           echo "Successful write<br>";       } else {           echo "Failed write<br>";           echo mysql_errno() . ": " . mysql_error() . "<br>";       } fclose($handle); For small files, it uploads perfectly.  For larger files, it fails.  I think I can change the parameter on MySQL to allow a bigger file to be uploaded to the blob field.  So, I tried to upload the bigger files to SQL Server 2000 instead of MySQL.  I can't upload those files because it would fail each time it encountered an apostrophe.  I can't change the apostrophe to another character because it's a TIF file that I'm trying to upload.  I used the same file to upload to the SQL Server 2000 database as I used to upload to the MySQL. Anyone have any success uploading big files to SQL Server using php?  I used to do it in VB - I loaded the tif into a stream and then put it in the file.  Anyone have any source code to do this? THanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.