egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

store img with tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Sat Sep 21, 2013 11:50 am    Post subject: store img with tcl Reply with quote

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
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 21, 2013 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Sat Sep 21, 2013 2:03 pm    Post subject: Reply with quote

Thanks i'll have a look at it, the db structure is in place. I just can figure out the code for it Sad

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber