T
Tomasz Chmielewski
I have a database which has a lot of files saved as blobs (some "fancy" CMS system).
I would like to save them as files.
I saved them as files using such a query (for each blob):
my $sql = $db->prepare("SELECT blob_data FROM tx_drblob_content WHERE uid = (?)");
$sql->execute($uid); # $uid is ID of the blob in the database
my $blob = $sql->fetchrow_array;
open BLOBFILE, ">$datadir/$uid" or die "Cannot open $!";
print BLOBFILE $blob;
close BLOBFILE;
Unfortunately, the files (PDF, ZIP etc.) are corrupted.
I "uploaded" a text file to the database using system's web interface, then fetched it with the above perl code.
Here are some example differences (- denotes original file; + denotes the file fetched with perl):
-# From ``Assigned Numbers'':
+# From ``Assigned Numbers\'\':
So we can see that the file has \ appended in front of each '.
Which could be because the CMS system stores the files as such, or perhaps I should fetch/save the files differently?
Does anyone have some obvious thoughts on why I see \ appended before certain characters?
I would like to save them as files.
I saved them as files using such a query (for each blob):
my $sql = $db->prepare("SELECT blob_data FROM tx_drblob_content WHERE uid = (?)");
$sql->execute($uid); # $uid is ID of the blob in the database
my $blob = $sql->fetchrow_array;
open BLOBFILE, ">$datadir/$uid" or die "Cannot open $!";
print BLOBFILE $blob;
close BLOBFILE;
Unfortunately, the files (PDF, ZIP etc.) are corrupted.
I "uploaded" a text file to the database using system's web interface, then fetched it with the above perl code.
Here are some example differences (- denotes original file; + denotes the file fetched with perl):
-# From ``Assigned Numbers'':
+# From ``Assigned Numbers\'\':
So we can see that the file has \ appended in front of each '.
Which could be because the CMS system stores the files as such, or perhaps I should fetch/save the files differently?
Does anyone have some obvious thoughts on why I see \ appended before certain characters?