mylesgrant.com

PHP Nokia Image Upload Server 0.3 Release

There’s a new version of my Nokia Image Upload Server code available now. This version represents a major rewrite, and should work better for everyone. I took the storage of data, and abstracted it into a class, so that we can easily add new storage media. This version contains the original MySQL storage driver as well as a new filesystem storage driver.

I also fixed a couple other bugs, as well as made the MySQL storage driver record the width and height of each image, so even if you don’t need the filesystem storage option, I would recommend upgrading.

As always, we have two choices here, a 13,432 byte gzipped-tar, and a 16,876 byte zip file.


36 Comments

Hi Myles, firstly thanks for creating a super script !

I’m situated in the UK, so I’m hoping that I might just need to tweak the setting on my phone, but I just can’t seem to get the script to work.

I’ve uploaded the SQL and the tales and UserName / PassWord are entered correctly, I “think” that I have set up the config.php correctly too, but for some reason it’s still not working.

I’ve got a 3650, and the upload settings are correctly entered, but even when I try to upload, nothing gets writtnig to a log file.

Out of interest, your upload settings in the phone, as they a GPRS or CSD connection ? I think that’s where my problem might be, but i’ve tried all the settings on my phone with no luck.

Posted by Skeddy on 28 April 2004 @ 4am

I’m using a GPRS connection.

It’s possible that your web server can’t create the log file because it doesn’t have permission to do so. If you’re running linux, and Apache, you can fix it by creating an empty file in your imageUpload directory named debug.txt. Then, change the permissions on it to world-writable by running ‘chmod 777 debug.txt’.

Let me know if that fixes it for you.

Posted by Myles on 28 April 2004 @ 11am

I checked and had the persmissions set to 777 already, and (possibly stupidly) all the files set to 777 as well.

I’ve re-checked my config.php, but I’ll e-mail you a copy just for a sanity check.

I’ve not been able to get the debug.txt file to have anything written to it.

Posted by Skeddy on 28 April 2004 @ 1pm

I have also problems with this script set. Phone only says, “cannot connect to server” other mms and gprs functions work just fine. Settings are doublechecked. I readed somewhere that http headers are crucial between different phone firmwares, like content length is necessary on some phones.

Posted by rahi on 29 April 2004 @ 1am

Hi Myles,

Your script runs perfectly for images uploaded from a Nokia 3620 and 6600.
I’m using the file system storage for my server.

Is there any way to eliminate the step on the phone where it asks me to choose the folder in which I want the image uploaded ?
Can it go stright into a default folder ?

Thanks!

Posted by Tushar on 10 May 2004 @ 7am

Hi !
I wonder if this wonderful thing works with Nokia 7650?
I installed it on Linux with Apache2.
In the access.log I have the following:

———————-
62.217.245.194 – - [18/May/2004:23:07:07 +0300] “POST /login/uploaderLogin.asp HTTP/1.1″ 404 345
62.217.245.194 – - [18/May/2004:23:12:22 +0300] “POST /login/uploaderLogin.asp HTTP/1.1″ 404 345
———————-

and of course I do not have any login stuff there
Also with debugging turned on it won’t write anything in debug.txt .
Maybe Nokia7650 requires SSL ??

Posted by Attila Varhelyi on 18 May 2004 @ 1pm

Attila,

It looks like your phone isn’t configured to access the right URL. It’s looking for a .asp file. I don’t have any experience with the 7650, but on my 3650 I can change the URL the phone uses to upload. I would poke around in your phone and see if you can change it. The URL should be the directory where you installed the image upload server. Example: http://example.com/imageUpload/

Posted by Myles on 19 May 2004 @ 9am

Hi Myles,
The 7650 lets me enter the URL, so the problem may be somewhere else. I just want to know, if anybody tried your script with this phone.
Actually I NEVER tried uploading images from the 7650,probably there could be a problem with my GPRS connection at Orange Romania ( which works fine for E-mail and Wap ).
So I would like to test it with a site that will accept my 7650 brick , which I could not find so far.

Posted by Attila Varhelyi on 19 May 2004 @ 2pm

Hi Myles,

Still haveing a few problems with the script.

Downloaded the version from Sorceforge, set up the directories and SQL, but am getting the following in my debug log:

GET data…
POST data…
1
Version=1.00
No version number passed.
GET data…
POST data…
Version => 1.0
Username => (MYsql Database Name)
Password => (MYsql password)
Language => EN
0
Version=1.00
SId=SessionId=10909469391648335297
RSURL=http://skeddy.net/imageUpload/remoteStorageCapabilities.php

Had a problem earlier when I had entered the wrong MYsql username into the global.php file, but the debug log told me that this was the problem. Currently, the log halts at this point and the phone then tells me that it couldn’t connect to the database.

Posted by skeddy on 27 July 2004 @ 9am

Hello,

I’ve been trying to get the image uploader to work but it always fails near the end.
I get “connecting to server eric”
I choose a folder, it says “uploading” and then says: “Upload interrupted, Unable to upload 1 image.”. I’m using a Nokia 6600 with T-Mobile.
thanks for any help.

Posted by Eric Paige on 30 August 2004 @ 4pm

I forgot to add the debug text from the last post. Here it is:

——————————
GET data…
POST data…
Version => 1.0
Username => *****
Password => *****
Language => EN
0

Version=1.00

SId=SessionId=10939117891377787688

RSURL=http://www.ericpaige.com/imageUpload01/remoteStorageCapabilities.php

GET data…
SessionId => 10939117891377787688
POST data…
0

CreateDirURL=http://www.ericpaige.com/imageUpload01/createDir.php

UploadURL=http://www.ericpaige.com/imageUpload01/upload.php

DirListURL=http://www.ericpaige.com/imageUpload01/dirList.php

GET data…
SessionId => 10939117891377787688
POST data…
0

2

2

DId=0

DirName=Test

DId=1

DirName=abc

GET data…
SessionId => 10939117891377787688
POST data…
DirId => 0
Filename => Image(057).jpg
MimeType => image/jpeg
ImageData =>

Posted by Eric Paige on 30 August 2004 @ 6pm

I have a Nokia 3200 and been dieing to have something like this. Email each one , 1 at a time was killing me. I set up all the files but when I go to the site I get this.

1 Version=1.00 No version number passed.

I have 3200 and AT&T mmode. I not sure where to add these settings on this phone or even if I could.

Main Menu, Options->Image Uploader->Settings. Select ‘Image servers

Posted by SX on 27 November 2004 @ 8pm

Can’t get it to work on Nokia 3200

Posted by SX on 27 November 2004 @ 9pm

I finally got everything set up corerctly onthe phone. but when I got to the site nothing happens. Here’s my debug log:

GET data…
POST data…
1
Version=1.00
No version number passed.

Posted by (SX) on 28 November 2004 @ 10am

I don’t have a 3200, so I can’t test. But if your phone is configured correctly (and if you’re getting a debug log when you try and upload from your phone, then it probably is), then it doesn’t look like your phone comforms to Nokia’s spec. I’ll try and do some more research on it.

Posted by Myles on 9 December 2004 @ 6pm

I’m having the same issue:

It’s not letting me upload: Unable to upload 1 images HELP!

/home//xnot.org/phone$ tail debug.txt
UploadURL=http://xnot.org/phone/upload.php
DirListURL=http://xnot.org/phone/dirList.php
GET data…
SessionId => 11053314951478309271
POST data…
0
1
2
DId=0
DirName=Vegas

Posted by Ari Lerner on 9 January 2005 @ 8pm

Ari, what storage method are you using? And can you email me your full debug log?

Posted by Myles on 10 January 2005 @ 7am

I’ve managed to get everything working. I can upload to database or to filesystem. The problem is I can not show the images. When I try to open the uploaded file with infranview it says “Can’t read file header” and when I try to output the data from the database the browser says it can not read the image. I can view the images from the phones memory fine. I use a 7610.

Posted by Torusknot on 27 January 2005 @ 3am

Torusknot: Can you send my one of the uploaded images? Maybe I can figure out what’s wrong.

Posted by Myles on 27 January 2005 @ 7am

What do u need to do if the debug.txt says No version number passed?

Posted by Mizan on 11 March 2005 @ 8pm

I think that means that your client on your phone is misbehaving. What phone do you have?

Posted by Myles on 14 March 2005 @ 7am

Im am using Nokia 3660. When i tried to upload my image, my phone says “unable to connect to Server”. Do i need to configure something.

Thanks

Posted by Mizan on 15 March 2005 @ 12am

what does “1 Version=1.00 No version number pa” means? and what verification will we users see if the scripts was succesfully installed?

Cool script!!

Posted by Nico on 16 March 2005 @ 2am

Myles, Thanks for the script. I’m looking forward to getting it working. I’m using the FS to upload images. I’ve set it all up, but my Nokia 6600 still cannot connect to the server. I’m on T-Mobile and other GPRS services work. I’ve put all the .php files in my timothyday.com/pivot_1/images/ directory and checked permissions. the debug log shows the following:
GET data…
POST data…
Version => 1.0
Username => timothyd
Password => ********
Language => EN
GET data…
POST data…

just can’t connect. Any thoughts?

Posted by Timothy Day on 2 May 2005 @ 10am

Myles, please disregard the question I sent you. After a few hours of tweaks. I got it all happening. Had to point my Nokia 6600 to the index.php directly, than change the directories in the global.php. Great job. Thanks for sharing it. I’ve posted a link to your site from on the pivotlog.net forum. Best, Tim.

Posted by Timothy on 2 May 2005 @ 11pm

Hi Myles,
I recently downloaded this script to run on my apache hosted server, as my email provider and my nokia 6600 don’t get along – so this was a great way of uploading my images etc

Everything runs perfectly, except for the permissions the script creates for the files (this is using the filesystem instead of SQL db) – it seems to give the images that are upload a null user and group (or 99 in this case) – and im unable to delete the images, directories at all on the server – as i get a “denied” error due to the permissions.
Is there anyway in the code (im a junior at php) of forcing the created files to have a set user/group permission?

Cheers,
Dom

Posted by Dominic S on 26 May 2005 @ 11am

Hey, Great script!! nice of you to sort of reverse engineer how the protocol works… If I use this in any of my web applications I’ll be sure to give you credit :)

Posted by Colin Jensen on 19 July 2005 @ 6pm

In reply to:
Hi Myles,
I recently downloaded this script to run on my apache hosted server, as my email provider and my nokia 6600 don’t get along – so this was a great way of uploading my images etc
Everything runs perfectly, except for the permissions the script creates for the files (this is using the filesystem instead of SQL db) – it seems to give the images that are upload a null user and group (or 99 in this case) – and im unable to delete the images, directories at all on the server – as i get a “denied” error due to the permissions.
Is there anyway in the code (im a junior at php) of forcing the created files to have a set user/group permission?
Cheers,
Dom

Find storage.inc.php and open it in a text editor, such as VI. Find the following lines:
// Move the uploaded file to the gallery directory
$fileMoved = move_uploaded_file($fileInfo['tmp_name'], $this->galleryDir . ‘/’ . str_replace(array(‘ ‘), array(‘_’), $galleryData['gallery_name']) . ‘/’ . $filename);

Then add the following line below it:

chmod($this->galleryDir . ‘/’ . str_replace(array(‘ ‘), array(‘_’), $galleryData['gallery_name']) . ‘/’ . $filename, 0777);

Thats what i did and it works, perfect for me now. Hope it helps…

Posted by Colin Jensen on 20 July 2005 @ 6pm

Does this script also work under Windows 2003 / IIS 6? I can’t get it running. How do I have to fill in the $imageUploadRoot variable when the php script is loaded into d:\www\website1\imageupload?
There are also no logfiles created.

Thanks!

Ruben

Posted by Ruben on 5 September 2005 @ 1pm

Ruben,

I haven’t tried it under Windows/IIS, so I don’t really know. Do other PHP scripts work?

Posted by Myles on 5 September 2005 @ 2pm

I’ve installed PHP on my IIS server and other scripts do run. So PHP functions well. It seems that your script wants a Linux/Unix path for $imageUploadRoot. I can ofcourse only fill in a windows path (e.g. d:\www\website1\imageupload).

Posted by Ruben on 30 September 2005 @ 5pm

Hi,

I’ve just found this script! I have it working perfectly on my N6600 except for the same problem that is described by Dominic (see above). Once my pics are uploaded, I can’t seem to delete them from my server. I have tried adding the extra line that Colin suggests, but this still doesn’t work. I have also tried manuall changing the permissions from 755 to 777 but they just revert back to 755…Any clues?

Apart from my little problem, Superb scripting Myles :-)

Posted by Neil on 8 November 2005 @ 3pm

The strange permissions are probably due to the Apache web server setup. Often times, Apache is setup to run as an “apache” user or as “nobody”. When that happens, any files it creates are owned by that user, and not by your user. The only way to delete the files is to then create a script that deletes them and run it from a web browser.

An example would be to create a delete.php script in your web root that looked like this:

<?php
unlink(‘/full/path/to/file.jpg’);
?>

And then go to http://mysite.com/delete.php to delete the file. You’ll want to remove the script after you’re done using it.

Posted by Myles on 8 November 2005 @ 3pm

Myles,

thank you very much! That works perfectly. It’s very kind of you to offer support – and so quickly as well. I would thoroughly recommend this script to anyone.

Now I’m off to hunt for something that can create automatic thumbnails of the images I upload!

Thanks again – and all the very best,

Neil.

Posted by Neil on 8 November 2005 @ 4pm

Hi,

Im using Nokia 6670, im using the FS system, powered by Win 2003 EE with IIS6, using PHP5.

My phone always said “Unable to connect server” when i tried to upload.

any solutions?

thx

Posted by pok on 15 January 2006 @ 2am

i own nokia 6600,and i found that there is a service called ‘image uploader’ in my phone,so i tried to use it..i put in all the settings corectly.but it still not working,how is it function?

Posted by Lachel on 17 October 2008 @ 3am

Leave a Comment



ss_blog_claim=15f221fa5534b36dfd4dc0c2bcca99c1