Nokia image upload module error with Galler y 2.1.1
|
zampa
Joined: 2005-09-18
Posts: 2 |
Posted: Wed, 2006-05-10 22:22
|
|
First message... Gallery is wonderful like the community behind it. Thanks for all ! I'm having some trouble with the nokia image upload module. I've already used this module with gallery v 1.5.x and Gallery 2 with Nokia 3650 and 6600; the only phones supported by the NOKIA IMAGE UPLOADER SERVER API V1.1. For what i know. I've already checked the Readme file of the module and done a search in the gallery forum. i've already sent a mail to the author of the module, jerome...unfortunately is busy in other projects and and left the module dev. 1 year ago...and changed his cell phone too (!) so is impossible for him to help me. (in any case thanks) My config is: Versione di Gallery = 2.1.1 core 1.1.0.1 The problem, for what i've understand (not much), started with the 2.1 upgrade. I've installed, configurated and activated the module. The album is created and a group with the correct permission for that album is also created after the activation. But every time i try to send a picture from the phone i've got, after few seconds, an error massage: a generic "impossible to connect to server"..which i think is a sort of "time out" error. i've tried to use a web browser to log in, as explained in the readme file of the module, to experiment and: 0 i think the login fuction is done correctly... but trying from the phone, for a strange reason, cannot handle the server response and after a few second shows an error. When the module was working the phone contacted server and after few seconds prompted with the available album to send the picture and the possibilty to create a new album. It's not a gprs connection problem as i've already tried with different operators. I've tried to use different urls in the phone settings: http://www.mygallery.it/gallery2/gallery2.php?g2_controller=nokiaupload.Login same result. it's a nice module, a bit outdated with the latest and popular camera phone, but fast and easy. I can survive without it (phone > pc > gallery) but i loved it... I hope a new, more generic camera phone module will be developed in the future (mms to gallery or email to gallery or shozu.com to gallery) but can someone help me with the actual one ? Thanks |
|

Posts: 8601
try editing nokiaupload/classes/ImageUploadHelper.class, line 123.
where it says 'forceSessionId' => false change false to true
does that help?
Posts: 2
Thanks for your answer...
I've tried editing the file you suggested but unfortunately with same result.
I've done some more testing & searching
i've resumed my old gallery 1.4.2, still on the server where the gallery2 is located, and the old version of the nokia upload module works perfectly.
So the problem is not related to the phone connection settings.
From the nokia image upload server api doc here:
http://sw.nokia.com/id/7454d52c-b384-40d1-b4bb-093126772dc0/Image_Upload_Server_API_v1_1.pdf
the login sequence with gallery2 seem ok from the web but from the phone ... errors.
May be a permission problem or a sintax error in the server response due to the process of adding/checking-in the user in the group created by the module ?
is it possible to modify the module so that, like the old version, instead of adding the logged user to the group, simply check if the user is registered and then upload the file to the album where the user has permission to post ?
i'm just trying to figure out where the problem can be...i'm not a programmer, my php knowledge is very limited and gallery2 is quite complex...
z
Posts: 8601
1.4.2? whatever code that is is totally unrelated to this G2 module, afaik.
maybe turn on logged debug module in config.php so you can get debug output when trying via the phone..
Posts: 8601
(got debug output in PM)
The debug output does confirm that the login is ok but the session gets lost between requests. Undo any change you made to ImageUploadHelper.class before ($rsurl should have 'forceSessionId' => false), and then change:
array('forceFullUrl' => true, 'htmlEntities' => false)) . '&';to:
array('forceFullUrl' => true, 'htmlEntities' => false, 'forceSessionId' => false)) . '&';THREE places in function getRSCapabilities, a little further down in ImageUploadHelper.class.
With this change in place, try again and PM me the debug output if it doesn't work... I'm not sure that it will because I see an extra ? in the debug output and I'm not sure where it comes from.
Posts: 8601
New debug output shows:
We want g2_GALLERYSID so G2 will recognize the session. The nokiaupload code says "API specification requires URL to end with '&' (or '?')", implying that the phone should not add a ? in the URL when it appends the session id, but it appears your phone IS adding a ?. Are you able to determine what version of the nokiaupload spec your phone uses? no idea if the phone would tell you that anywhere....
You might try commenting out the $rsurl .= '&'; line in ImageUploadHelper.class and see if that has any effect. Otherwise, uncomment that again and try this hack: edit main.php in the top of your G2 install.. near the top just after the include line for bootstrap.inc add this:
if (isset($_GET['?g2_GALLERYSID'])) $_GET['g2_GALLERYSID'] = $_GET['?g2_GALLERYSID'];This is a hack, but it's one line.. much easier than any other workaround would be.
Posts: 8601
Next output shows the hack got you successfully through one more request, but the next request sent:
?3e2a7a80a3ed00dc2436fe6sessionidie, now the g2_GALLERYSID= portion is missing, and the extra ? is still there.
either your phone's software is buggy or it is using a different version of this nokia API.. it is not interacting with G2 the way this module expects.
Posts: 2
I've got a Nokia 3650 and Gallery 2.1.1, and I seem to be running into the same problems Zampa did. I'd be glad to help debug this -- could somebody tell me where the debug output goes in a phone post scenario? That is, after I enable debug mode in the config file, where do I look to see the output?
Posts: 8601
try using 'logged' debug mode.. see instructions in config.php. with this mode the debug output goes to the file you specify.
Posts: 2
Hi all,
I had the self-same problem, but thank to the suggestions above, and some creative changes, I managed to get it working!
Here's what I changed:
In nokiaupload/classes/ImageUploadHelper.class, change line 158 onwards from...
$createDirUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.NewDirectory'), array('forceFullUrl' => true, 'htmlEntities' => false)) . '&'; $uploadUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.Upload'), array('forceFullUrl' => true, 'htmlEntities' => false)) . '&'; $albumListUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.DirectoryListing'), array('forceFullUrl' => true, 'htmlEntities' => false)) . '&';...to...
$createDirUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.NewDirectory'), array('forceFullUrl' => true, 'htmlEntities' => false, 'forceSessionId' => false)) . '&'; $uploadUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.Upload'), array('forceFullUrl' => true, 'htmlEntities' => false, 'forceSessionId' => false)) . '&'; $albumListUrl = $urlGen->generateUrl( array('controller' => 'nokiaupload.DirectoryListing'), array('forceFullUrl' => true, 'htmlEntities' => false, 'forceSessionId' => false)) . '&';At the top of Gallery 2's main.php, after line 23:
...insert the following extra line:
...and that's it - this made it work for me using a Nokia 6600.
This was all using the Nokia Image Upload module v 1.0.3 and Gallery 2.2.1.
Dave.
Posts: 2
Thanks for the info, Dave... Unfortunately I couldn't get the fix to work with my setup (Module 1.0.3, Gallery 2.2.1, Nokia 3650 phone) -- I got the same error as before. Was there anything else you changed -- or is there anything else I could try? Seems like the fix works because it bypasses the problem of the phone losing the session id in the middle of the connection, before it's started the upload of the photo?
Posts: 2
Hi there,
When I eventually tracked down the problem, it had two parts:
1) The initial server response was returning a bogus session ID value
My mistake initially was that I couldn't see this problem when testing the server in my web browser. As described in the Image Uploader readme, you can test the server by going to:
http://your.gallery/main.php?g2_controller=nokiaupload.Login&Username=<username>&Password=<password>
...and you see the initial response from the server: something like this (I think) with the default install if you view it with a normal web browser:
However, this actually isn't a good test, as your browser probably has cookies enabled, and Gallery responds to sessions differently if cookies are enabled. So, I turned off cookies in my browser, and tried again, and found that what I actually got (and also what the phone would actually be seeing, as it doesn't have cookies) was this:
Without cookies, the upload module was inserting TMP_SESSION_ID_DI_NOISSES_PMT in those three URLs, rather than the actual session ID, and so this bogus value of the g2_GALLERYSID session variable was being returned to the upload module when the phone next made a request, losing the real session.
So, I removed the g2_GALLERYSID part of those three URLS, by adding in the
, 'forceSessionId' => false)code. The ID doesn't need to be in there anyway - the whole point of this line:...is that the Nokia phone will append this ID to the end of all URLs anyway. This solved the problem of getting a bogus ID each time, and meant that the initial server response to the phone was now:
2) Having done this, I found that the phone still wasn't passing g2_GALLERYSID back correctly in its second and subsequent requests. Further debugging showed that it was now requesting (for example):
See in the middle of the URL there? It should be
DirectoryListing&g2_GALLERYSID, but the phone has inserted an additional "?". The Nokia upload API spec states that URLs should end in an ampersand if they already contain query string parameters, but the phone doesn't seem to respect this, and appends a new query string, beginning with the question mark, even though one already exists.As a result, the upload module reported that it was getting the following two values out of the query string shown above:
g2_controller => nokiaupload.DirectoryListing ?g2_GALLERYSID => 7e490f3c639eb14e827a2596386a2ef9...when what it needs is:
g2_controller => nokiaupload.DirectoryListing g2_GALLERYSID => 7e490f3c639eb14e827a2596386a2ef9So, my hack to the top of main.php simply checks for a value of $_GET['?g2_GALLERYSID'], and creates a matching value of $_GET['g2_GALLERYSID']. This means that Gallery 2 still thinks it has a valid session id on the second and subsequent calls.
Don't think I changed anything else, but hopefully this might help you to debug if the same problems are happening for you. Have you been able to turn file logging debugging on? That will help a lot. If you have, post the output here, and I'll take a look!
Dave.
Posts: 2
Wish I could get my N95 (Symbian) to upload to my egroupware Gallery2...
Posts: 1
Did you ever get your n95 to work?
Posts: 2
I'm still looking. I'd really like to get away from Flickr, Picasa, etc. to my own!
Posts: 5
Whats the latest news? I want to use my Nokia 5800 and/or my Nokia N95 to upload photos.
Posts: 16503
There is a module for G2 that looks like it works with the Nokia 3650 and 6600, but nothing more:
http://codex.gallery2.org/Gallery2:Modules:nokiaupload
http://codex.gallery2.org/Gallery2:Download#Modules
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here