Add an entire folder!

killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2004-12-27 10:36

Hey!

Is it not possible to add an entire folder that itself contains several folders with pictures within them?

C:\folder\folder\folder\folder\pictures
C:\folder\folder\pictures

And so on..... Yeah, you get the point! :roll:

The thing is that here at work I have about 200 folders and 80GB of pictures and to add one and one folder will take some time!

Cheers from Sweden!

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Mon, 2004-12-27 11:40

There exists a "gallery2add.pl" or something like that I believe, maybe someone will post a link to it. You could try the FAQ at the top of the forum, but I'm not sure if its in there or not.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2004-12-27 12:14

Hmm, nooo... I can't find anything about that one... Either in FAQ or Google! :-?

Thanks anyway!

Anyone else?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2004-12-27 12:25
 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2004-12-27 13:47

Ah... Cool! :D

So, for a newbie like me on G2 - Where should I put that file? Folder?

And I guess it should be other/g2add.pl 24K!?!!

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2004-12-27 13:50

killerstrom, you run it from the computer you want to upload from.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2004-12-27 14:17

Okey!

I guess it would be better if I had Linux now to run a Perlscript, do you know any good software to run perlscript on my Windows installation (with Apache)?

Will try ActivePerl software now... But maybe you know someone good?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2004-12-27 14:19

It should run in ActivePerl, you might need to install some modules for it. Afaik there are some instructions in the script itself.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2004-12-27 14:25

Great lad.... I will try this as soon as it is installed...

Thanks! :)

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Wed, 2004-12-29 08:39

Okey!

Now I have been trying this "g2add.pl" alot and still don't getting it to work somehow, anyone up for some support? *please* ;)

This is how it looks:

perl g2add.pl -l [domain]/gallery/ -a origoarkivet -u [username] -p [password] D:\g2data\albums\origoarkivet
Logging In
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
Album does not exist: origoarkivet

And that album sure does exists, i have been trying other aswell. And I still get the same "error" message.

Please please..... please!

Cheers!

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Wed, 2004-12-29 09:21

killerstrom, G2add.pl uses the Gallery Remote protocol, which expects the id of the album to which you will be adding the images. :/ If you do not have short urls turned on in G2, then it will be easy to get the id. If you have short urls turned on, then you can find out the id by editing the properties of the album and looking at the url.

Any folders that you specify on the command line will be added to the album that you specify, so you would end up with origoarkivet/origoarkivet in G2. To prevent that, you can add that folder to the gallery root. You will probably have to find out the root id by editing the properties.

It looks like you have already put your images into the G2 data directory? If so, you will need to move them somewhere else, or G2 will get confused.

Here's an example command line:
perl g2add.pl -l [domain]/gallery/ -a 5 -u [username] -p [password] D:\images\origoarkivet

Let me know if you have any further trouble. Thanks!

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Wed, 2004-12-29 15:12
C:\>perl g2add.pl -l [domain]/gallery/ -a 1503 -u admin -p [password] c:\arkiv
Logging In
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
Found album '1503'
Creating Album 'c:/arkiv'
Album 'arkiv' created successfully as 1504
#__GR2PROTO__
album_name=1504
status=0
status_text=New-album successful.
debug_user=admin
Creating Album 'c:/arkiv/byggtiden'
Album 'byggtiden' created successfully as 1505
#__GR2PROTO__
album_name=1505
status=0
status_text=New-album successful.
debug_user=admin
Ignoring 2000-03-15.eps
Uploading image 'c:/arkiv/byggtiden/2000-03-15.jpg'
setcaption not active
POST http://bilden.kvab.local/gallery//main.php
Content_Type => 'form-data'
Content      =>
        g2_controller => remote:GalleryRemote
        protocol_version => 2.5
        cmd => 'add-item'
        set_albumName => 1505
        setcaption => ''
        g2_userfile => "c:/arkiv/byggtiden/2000-03-15.jpg"

<br />
<b>Notice</b>:  Undefined index:  caption in <b>C:\Program Files\Apache Group\Ap
ache2\htdocs\gallery\modules\remote\GalleryRemote.inc</b> on line <b>315</b><br
/>
<br />
<b>Notice</b>:  Undefined index:  caption in <b>C:\Program Files\Apache Group\Ap
ache2\htdocs\gallery\modules\remote\GalleryRemote.inc</b> on line <b>316</b><br
/>
#__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin
Could not upload image 'c:/arkiv/byggtiden/2000-03-15.jpg':     Unknown error 20
0       <br />
<b>Notice</b>:  Undefined index:  caption in <b>C:\Program Files\Apache Group\Ap
ache2\htdocs\gallery\modules\remote\GalleryRemote.inc</b> on line <b>315</b><br
/>
<br />
<b>Notice</b>:  Undefined index:  caption in <b>C:\Program Files\Apache Group\Ap
ache2\htdocs\gallery\modules\remote\GalleryRemote.inc</b> on line <b>316</b><br
/>
#__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin

This is the error message I get when I run the "g2add.pl" now, but I have a question aswell... The thing is I wanna have the folder structure as it is now (see above, first message) even in G2. Is that possible with this "g2add.pl" or not? If not we don't need to worry more about this problem. If we can get this to work I can ensure you guys that my boss will send a donation of money (he told me that before) to Gallery, he is more than happy for this one instead of buying something expensive other stuff.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Wed, 2004-12-29 17:45

killerstrom, that was a bug in g2add.pl. I just fixed it, so if you download a new copy it should work for you. Thanks!

By the way, you can request me through the "paid support" part of this website if you need customizations made to g2add.pl or quicker support.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Thu, 2004-12-30 04:13

jumullan ... ah, thanks... I will try this as soon as I get to work!

Thanks mate! :wink:

Happy New Year! :D

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Thu, 2004-12-30 07:06

jmullan... Opps, still problems!

I downloaded the latest version that you have uploaded and now I get this error message.

C:\>perl g2add.pl -l bilden.kvab.local/gallery/ -a 1503 -u admin -p [password] C:\arkiv
Logging In
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
Found album '1503'
Creating Album 'C:/arkiv'
Album 'arkiv' created successfully as 1513
#__GR2PROTO__
album_name=1513
status=0
status_text=New-album successful.
debug_user=admin
Creating Album 'C:/arkiv/byggtiden'
Album 'byggtiden' created successfully as 1514
#__GR2PROTO__
album_name=1514
status=0
status_text=New-album successful.
debug_user=admin
Uploading image 'C:/arkiv/byggtiden/2000-03-15.eps'
setcaption not active
POST http://bilden.kvab.local/gallery//main.php
Content_Type => 'form-data'
Content      =>
        g2_controller => remote:GalleryRemote
        protocol_version => 2.5
        cmd => 'add-item'
        set_albumName => 1514
        caption => ''
        g2_userfile => "C:/arkiv/byggtiden/2000-03-15.eps"

#__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin
Could not upload image 'C:/arkiv/byggtiden/2000-03-15.eps':     Unknown error 200       #__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin

Is this problem my fault or the script? I think I have tried everything here now to get this to work just fine. Been checking all the parameters I can think of. Checking the security and so on. But there are still problems. Upload via Remote Gallery works, but not good... often it stops to upload images. And I still don't get the structure I want.. (my boss wants). As the mather of fact, that structure are pretty good in our enviroment.

So any ideas?

Cheers from Sweden!

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Thu, 2004-12-30 08:21

Can you upload that eps file through the normal interface?

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Thu, 2004-12-30 08:58

jmullan... Hey, first I wanna thank you for all the support you give me. I am more than happy.

It works just fine to upload and download *.eps (off course not show via G2) via the normal webinterface.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2005-01-03 14:37

Doing some updates here now...
I am in a desperate need of good help.

This is the error message I got now when I run g2add.pl

C:\>perl g2add.pl -l domain/gallery -a 1619 -u admin -p password C:\arkiv
Logging In
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
Found album '1619'
Creating Album 'C:/arkiv'
Album 'arkiv' created successfully as 1626
#__GR2PROTO__
album_name=1626
status=0
status_text=New-album successful.
debug_user=admin
Creating Album 'C:/arkiv/byggtiden'
Album 'byggtiden' created successfully as 1627
#__GR2PROTO__
album_name=1627
status=0
status_text=New-album successful.
debug_user=admin
Uploading image 'C:/arkiv/byggtiden/2000-03-15.eps'
setcaption not active
POST http://domain/gallery/main.php
Content_Type => 'form-data'
Content      =>
        g2_controller => remote:GalleryRemote
        protocol_version => 2.5
        cmd => 'add-item'
        set_albumName => 1627
        caption => ''
        g2_userfile => "C:/arkiv/byggtiden/2000-03-15.eps"

#__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin
Could not upload image 'C:/arkiv/byggtiden/2000-03-15.eps':     Unknown error 200       #__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin

It is still possible to upload *.eps images via the usual web interface but not via "Remote Gallery".

Any ideas, someone??? :|

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Mon, 2005-01-03 18:52

So you can add the files via the web interface but not g2add.pl or Gallery Remote (the java client) ?

You should really consider just contracting me for an hour or two to work directly with you on this.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Tue, 2005-01-04 07:23
Quote:
So you can add the files via the web interface but not g2add.pl or Gallery Remote (the java client) ?

You should really consider just contracting me for an hour or two to work directly with you on this.

Yes, I can add files (not create an entire folderstructure with files that I wanna have) via the web interface and with the Gallery Remote java application but not with g2add.pl.

"g2add.pl" just creates some of the folders and then it stops to upload any files. I thought it was a security problem at first, but no. The folders I use have Everyone:F.

And about the contracting, I should take a chat with my boss about that jmullan. If he consider this G2 is good in our inviroment that should not be any problem at all. You have been very helpful so far.

Cheers from Sweden!

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Tue, 2005-01-04 09:01

Could you try a test album with just a jpg in it? That's the next test.

This is an oddity and the error message isn't giving me a whole lot to work with.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Tue, 2005-01-04 09:47
C:\>perl g2add.pl -l domain/gallery -a 1619 -u admin -p password C:\arkiv
Logging In
Logged In successfully
Fetching list of albums (may be slow)
Fetched list of albums.
Found album '1619'
Creating Album 'C:/arkiv'
Album 'arkiv' created successfully as 1631
#__GR2PROTO__
album_name=1631
status=0
status_text=New-album successful.
debug_user=admin
Creating Album 'C:/arkiv/byggtiden'
Album 'byggtiden' created successfully as 1632
#__GR2PROTO__
album_name=1632
status=0
status_text=New-album successful.
debug_user=admin
Uploading image 'C:/arkiv/byggtiden/2000-03-15.jpg'
setcaption not active
POST http://domain/gallery/main.php
Content_Type => 'form-data'
Content      =>
        g2_controller => remote:GalleryRemote
        protocol_version => 2.5
        cmd => 'add-item'
        set_albumName => 1632
        caption => ''
        g2_userfile => "C:/arkiv/byggtiden/2000-03-15.jpg"

#__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin
Could not upload image 'C:/arkiv/byggtiden/2000-03-15.jpg':     Unknown error 200       #__GR2PROTO__
status=403
status_text=Upload failed: ''.
debug_user=admin

Now I deleted all other files like *.tif, *.eps and so on and just saved *.jpg-files in the testfolders but I got the same result as before as you can see above. The folders it creates just fine, they get an ID in the database and I see them in the web interface and I can delete them aswell. But the rest... Hmm, strange! :-?

Sorry about the little info you get from this error message, if you can think of any other thing I could do to get any more specific error message just let me know. That is all it shows right now.

Thanks m8! I owe you one...

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Fri, 2005-01-07 06:44

Making this one active again....

Anyone up for some support in this matter? :-?

Thanks!!

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Fri, 2005-01-07 08:43

Feel free to drop me a line at

or contact me via AIM or any of the contact methods available. We would need to edit your G2 to get any more troubleshooting data out of it. Give me a holler if you see me online.

Otherwise, there aren't a lot of people familiar with the remote protocol or galleryadd.pl.

 
killerstrom

Joined: 2004-12-27
Posts: 20
Posted: Mon, 2005-01-10 08:30

I don't know if you seen my mail, but I send one last week....

Cheers from a windy Sweden!