'add-item' unknown?

kbeen

Joined: 2003-04-23
Posts: 15
Posted: Wed, 2003-06-25 16:52

Hi.

This is kind of a continuation of a post here:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=6559

I have made a script that posts images to Gallery from mobile phone , and it works great with the latest Galleryu release, however, I have a user who is using an older version of Gallery (reluctant to upgrade because of all the work he put into customizing his) and it doesnt work with his gallery_remote2.php

The request I send is

[ "cmd" => 'add-item',
 "protocol_version" => '2.0',
"set_albumName" => "kevin",
"force_filename" => '1',
"caption" => "",
"userfile"   => ["/tmp/octolefton.jpg", "octolefton.jpg"],

The error I am getting is

#__GR2PROTO__
status=301
status_text=Command 'add-item' unknown.

However, he sent me his gallery_remote2.php file, and there is an add-item command in there of course.

Any ideas? Is there still some way to do this using gallery remote without upgrading his gallery?

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2003-06-26 09:54

What's his exact Gallery version number?

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Thu, 2003-06-26 17:05

1.3.3
Thanks so much if you can help us.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2003-06-26 17:11

OK, add-item should definitely be available. Can you private-message me login information so I can test the gallery myself?

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2003-06-27 00:29

OK, I tested this Gallery install with the latest version of GR 1.1, and it works fine.

Would it be possible that the cookie info for username/pass would be sent wrong? Or that the wrong username/pass is sent wrong?

I'll try to see what could cause this behavior in older gallery_remote2.php versions. I remember the error handling was not the great a while ago.

In any case, the error message is misleading: add-item is there and it works.

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Fri, 2003-06-27 00:36

when you talk about cookies, could it be also linked to the way MY website on its own, handles cookies?

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2003-06-27 00:40

It might. But since this works with your other test Gallery, the cookie handling probably works.

Would it be possible to get a dump of the HTTP traffic between the Mfop server and the Gallery server?

 
kbeen

Joined: 2003-04-23
Posts: 15
Posted: Fri, 2003-06-27 00:49

It's not http dump, but this is from my logs when I send
Hmm I just tried again to his Gallery, and got this result

Get cookie:

http://www.xxxx/gallery_remote2.php?cmd=login&protocol_version=2.0&uname=xxxxxx&password=xxxxxxx

Returned

HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Date: Fri, 27 Jun 2003 00:40:05 GMT
Pragma: no-cache
Server: VHFFS 2.0 / Apache/2.1.0-dev (Unix)
Content-Type: text/plain; charset=ISO-8859-1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Client-Date: Fri, 27 Jun 2003 00:39:41 GMT
Client-Peer: 80.67.180.86:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Set-Cookie: b=deleted; expires=Thu, 27-Jun-02 00:40:04 GMT; path=/
Set-Cookie: b=imc; path=/
Set-Cookie: PHPSESSID=9e2261cfc493d19addf4e6ebfbd714c2; path=/
X-Powered-By: PHP/4.2.2

#__GR2PROTO__
server_version=2.1
status=0
status_text=Login successful.

Sent next query to post the photo (with cookie):

POST http://www.xxxxx/gallery_remote2.php,
       Content_Type => 'multipart/form-data',
       Cookie => b=deleted; expires=Thu, 27-Jun-02 00:40:04 GMT; path=/, b=imc; path=/, PHPSESSID=9e2261cfc493d19addf4e6ebfbd714c2; path=/,
       Content      => [ "cmd" => 'add-item', 
                         "protocol_version" => '2.0',
                         "set_albumName" => "kevin",
                         "force_filename" => '1',
                         "caption" => "Thisi s is",
                         "userfile"   => ["/tmp/klee1.jpg", "klee1.jpg"],
                       ]gallery
 
kbeen

Joined: 2003-04-23
Posts: 15
Posted: Fri, 2003-06-27 01:00

The exact same thing works on my own gallery

 
kbeen

Joined: 2003-04-23
Posts: 15
Posted: Fri, 2003-06-27 01:09

The response from the posting of the message to the version that doesn't work is

HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Date: Fri, 27 Jun 2003 01:06:08 GMT
Pragma: no-cache
Server: VHFFS 2.0 / Apache/2.1.0-dev (Unix)
Content-Type: text/plain; charset=ISO-8859-1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Client-Date: Fri, 27 Jun 2003 01:05:45 GMT
Client-Peer: 80.67.180.86:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Set-Cookie: b=deleted; expires=Thu, 27-Jun-02 01:06:08 GMT; path=/
Set-Cookie: b=honda; path=/
Set-Cookie: PHPSESSID=f77d96280e90b4f7b0e5e3e488aae45f; path=/
X-Powered-By: PHP/4.2.2

#__GR2PROTO__
status=301
status_text=Command 'add-item' unknown.

Sending to my own gets


Status: 0 (expected 0)IN UTIL ITEMCAPTUREDATE = 2003
#__GR2PROTO__
status=0
status_text=Add photo successful.

Don't know if that helped...

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Fri, 2003-06-27 06:12

could it be due to the fact that my gallery is embedded?
I think I just had an idea...
p

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2003-07-01 07:48

If the gallery is embedded, the user you're using to connect to it must be declared in Gallery itself (ie: not be one of the users of the embedding CMS, but a user that is available when Gallery is used in standalone mode).

I'm going on vacation today; I'll be back on the 16th and I'll work on this problem then. Sorry.