List Info

Thread: Uploading a file in a blob mysql column




Uploading a file in a blob mysql column
user name
2006-11-14 21:17:16
Hi

I searching on the web and reading for the last two day's
and I did not

find any code exemple to upload a file from my web page to
blob mysql
column.  I tried a little code but it does not work.


open my $handle, "< $pictures" or die
"Can't open $pictures : $!";
binmode ($handle);
$afbeelding = <$handle>;


$newItem1="insert into item1
values('$afbeelding')";


I also tried to display this pictures but I does not work.


my $test=$Row->;
binmode $test;
print $test;


Can you point me to the right direction.    thx in advance


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Perl Programming" group.
To post to this group, send email to perl-programminggooglegroups.com
To unsubscribe from this group, send email to
perl-programming-unsubscribegooglegroups.com
For more options, visit this group at 
http://groups-beta.google.com/group/perl-programming
-~----------~----~----~----~------~----~------~--~---

Uploading a file in a blob mysql column
user name
2006-11-15 00:54:24
open my $handle, "< $pictures" or die
"Can't open $pictures : $!";
binmode ($handle);
$/=undef;
$afbeelding = <$handle>;

2006/11/15, Maxou06 <soccermaniaquehotmail.com>:
>
> Hi
>
> I searching on the web and reading for the last two
day's and I did not
>
> find any code exemple to upload a file from my web page
to blob mysql
> column.  I tried a little code but it does not work.
>
>
> open my $handle, "< $pictures" or die
"Can't open $pictures : $!";
> binmode ($handle);
> $afbeelding = <$handle>;
>
>
> $newItem1="insert into item1
values('$afbeelding')";
>
>
> I also tried to display this pictures but I does not
work.
>
>
> my $test=$Row->;
> binmode $test;
> print $test;
>
>
> Can you point me to the right direction.    thx in
advance
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Perl Programming" group.
To post to this group, send email to perl-programminggooglegroups.com
To unsubscribe from this group, send email to
perl-programming-unsubscribegooglegroups.com
For more options, visit this group at 
http://groups-beta.google.com/group/perl-programming
-~----------~----~----~----~------~----~------~--~---

Uploading a file in a blob mysql column
user name
2006-11-15 18:45:20
Thx for your response but I still have a error.


This is my message error:

DBD::mysql::st execute failed: You have an error in your SQL
syntax;
check the manual that corresponds to your MySQL server
version for the
right syntax to use near '' at line 1 at
./main/Restaurants/Admin/Admin.pm line 1342, <$handle>
chunk 1.


Thx for your response


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Perl Programming" group.
To post to this group, send email to perl-programminggooglegroups.com
To unsubscribe from this group, send email to
perl-programming-unsubscribegooglegroups.com
For more options, visit this group at 
http://groups-beta.google.com/group/perl-programming
-~----------~----~----~----~------~----~------~--~---

Uploading a file in a blob mysql column
user name
2006-12-05 08:49:58
try making use of mysql function LOAD_FILE, and change the
sql
statement to :-

        $newItem1="insert into item1 (pictures) values
LOAD_FILE('$pictures')";

This will avoid the task of opening reading file in
Perl......


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Perl Programming" group.
To post to this group, send email to perl-programminggooglegroups.com
To unsubscribe from this group, send email to
perl-programming-unsubscribegooglegroups.com
For more options, visit this group at 
http://groups-beta.google.com/group/perl-programming
-~----------~----~----~----~------~----~------~--~---

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )