Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Bulk upload of links, with images?

Quote Reply
Bulk upload of links, with images?
Hi. I'm trying to write a link import script. I also need to import the images that are held in one of the fields. Basically, I will have something like;

ID|Title|Category|ImageURL|Description .. etc

I am working with 'uploaded' images (i.e they are uploaded locally). I'm trying to work out how LinksSQL handles the file uploads? Anyone got any pointers of where to look for this? Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bulk upload of links, with images? In reply to
Ha ha.. I have no idea how to do this :)

But here is an idea...

For the image field, why not specify the path like /path/to/image1.gif, /path/to/image2.gif for every listing/link that has image.

Next, you can ftp all the images from one server to another.

Let me know if it works.. :)

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Bulk upload of links, with images? In reply to
Wish it was that simple. Getting the file locally isn't a problem. Just use chdir() and get() to grab the file, and then copy() (from File::Copy) to move the file to another filename. The problem is, that they have numbers in front of them too, and they also have random 0-9 folder names (when you use the HASHED saving method).

I'm still trying to work out quite how LSQL actually works out where its going to save the file too, and what to rename it too :(

Thanks anyway :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bulk upload of links, with images? In reply to
Andy,

This is something I gave a lot of thought to, and put a host of my musings on-line awhile back. Here are some threads with some of the info, and others on the upload/image stuff I was working on (some before your time <G> Links 1.1x)



http://gossamer-threads.com/perl/gforum/gforum.cgi?post=216912;search_string=image%20file%20upload;t=search_engine#216912

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=147969;search_string=image%20file%20upload;t=search_engine#147969

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=212426;search_string=image%20file%20upload;t=search_engine#212426

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=67474;search_string=image%20file%20upload;t=search_engine#67474

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=151608;search_string=image%20file%20upload;t=search_engine#151608

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=148308;search_string=image%20file%20upload;t=search_engine#148308

http://gossamer-threads.com/perl/gforum/gforum.cgi?post=121460;search_string=image%20file%20upload;t=search_engine#121460


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Andy] Bulk upload of links, with images? In reply to
Hey Andy,

I almost hate to ask, but let me get this straight...

Do the import problems your talking about ONLY occure when links with image uploads are imported to another active installation? On an installation with links an uploads already present??? Guess I can see where that probem may exist.

I'm about to move to a new server. I thought I could just load the sql dump and transfer all my upload directories as they are on my original installation for everything to work properly. Knowing how my site works, do you forsee any problems I may have with the import to a new install??? God I hope not!

One more thing...

I've been planning to use that same links database and images uploads to feed simillar sites. I should have no problem feeding another install using that identical db and upload directories right???

Thanks for any answers bro!
Quote Reply
Re: [Jonze] Bulk upload of links, with images? In reply to
Your question doesn't really match what I am asking... but I'll try and answer it anyway ;)

THe problem is that file names are kept as a full path in the MySQL database. You need to basically modify the lsql_Links_Files table, so that the Relative_Path stuff reflects your new servers paths :)

Not an easy task overall :(

Quote:
I've been planning to use that same links database and images uploads to feed simillar sites. I should have no problem feeding another install using that identical db and upload directories right???

You *may* have to do some stuff with the values passed out.. I could be wrong though. Not something I would like to do myself, put it that way :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bulk upload of links, with images? In reply to
Sorry bout that... guess I'm misunderstanding your orignal question about the import problems. Thanks for answering my questions though. Unfortunatly it looks like my concerns were well placed...

I could have sworn the Links_Files table only held the partial directory structure like /images/1/ . Unsure

Guess I better start finding some SQL commands ( if there is a wasy ) to change all the relative paths when the time come to jump servers.

Quote:
You *may* have to do some stuff with the values passed out.. I could be wrong though. Not something I would like to do myself, put it that way :)


How about for some $$$? =) I can only imagine what a tough job for you, would be to me! I'll have to tackle that when the time comes though.

Thanks mon
Quote Reply
Re: [Jonze] Bulk upload of links, with images? In reply to
>>>I could have sworn the Links_Files table only held the partial directory structure like /images/1/ . <<<

Until 2.1.1 this was true. 2.1.2 brought out the feature of $file->Relative_Path; , which gives and $file->Relative_URL. These give you either the full path to the file, or the URL. I'm pretty sure this is how it works.. although I could always be wrong :p

>>>How about for some $$$? =) I can only imagine what a tough job for you, would be to me! I'll have to tackle that when the time comes though. <<<

Are you in a mega rush to move servers? IF not, and you can hold on for 2 weeks, I should be able to do it then :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Bulk upload of links, with images? In reply to
Thanks for that explaination... thought I was loosing it. Crazy

Quote:
Are you in a mega rush to move servers? IF not, and you can hold on for 2 weeks, I should be able to do it then :)


Well, I think I can handle the move. I just found a find and replace MySQL command to change the files paths on the new server...

For anyone this may help in the future:
update TABLE set COLUMN = replace(COLUMN, OLD_VALUE, NEW_VALUE); The part I may need help on is feeding other sites using the same data and uploads. This won't be needed for some time though. I haven't even thought of starting the new template sets. I may need some more custom work done before that though. Later