| View previous topic :: View next topic |
| Author |
Message |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Sat Sep 21, 2013 11:50 am Post subject: store img with tcl |
|
|
Hey!
Im trying to store img in my database (mysql)
How do i do that
it should store it from a url from my channel. And users should be able to request the img with a cmd. _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Sep 21, 2013 1:12 pm Post subject: |
|
|
If I understand you correctly, what you need to do, is to use the http package to retrieve the image data from the posted URL.
You'd then use the mysqltcl lib to insert the image data into a SQL table of your choosing.
As for "requesting" the image, once again use mysqltcl to extract the data from the table, and provide it to the user in whatever fashion you've intended (which is not specified in your post, by the way).
You should be aware that tcl is not really an efficient data handler, and might consider using a temporary file as intermediate storage for large files. You'd probably want to look at the -channel option for ::http::geturl, and use the LOAD_FILE() function with your INSERT SQL-query in this case. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Sat Sep 21, 2013 2:03 pm Post subject: |
|
|
Thanks i'll have a look at it, the db structure is in place. I just can figure out the code for it
EDIT: Would i could use something like this to store the img on the server, and maybe in the insert query do it so it insert the patch to the img in the db
http://forum.egghelp.org/viewtopic.php?p=99547#99547 _________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
|