I’ve been running into many problems when trying to upload photos to Facebook. I usually select a large number to upload at once and then the browser starts to do its thing. Unfortunately, lately it always fails.
I did a Google and found quite a few other people with the same problem but there didn’t seem to be any silver bullet to solving the problem.
I found I had an hour or two on the weekend to investigate it further and eventually was able to upload the latest photos from our Italy trip.
First I looked at the Java console log and found this error message:
Starting upload 2/08/2008 01:27:29 org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded INFO: Redirect requested but followRedirects is disabled Status = 2/08/2008 01:27:29 org.apache.commons.httpclient.HttpMethodBase getResponseBody WARNING: Going to buffer response body of large or unknown size. Using getResponseAsStream instead is recommended. UploadException occured
I Googled these errors and didn’t find much but did find a Facebook discussion where others had the same problem. It seemed that the uploader would try to upload the photos, then get near the end, wait for a response from the Facebook server, and then decide to try uploading all the photos again.
Just to rule the browser out of things, I tried switching from Firefox to Internet Explorer. Fortunately, it made no difference :)
I then made sure I had the latest Java toolkit and Java console. It still made no difference.
In Internet Explorer, I checked the ActiveX controls I’ve downloaded and found that my PC actually had 3 different Facebook uploaders but was only using one. Just to be sure, I deleted all of them and went back to the Facebook site again to reinstall it. It still made no difference.
I then experimented with the number of photos to upload. It could be a problem with the number of photos or the time taken to upload the photos. Here is a screenshot of some rough notes I took:
I managed to get up to 18 photos to upload at once with no problems. Momentarily I was joyous! I could upload my holiday photos in batches of 18, although I still have problems trying to make out the photos in the thumbnail view.
This went all right, until it failed again. And this time on only 11 photos. I reduced the number down to 6, then down to 1 – and it still failed.
Check internet connection – OK.
It turns out that the Facebook photo uploader was having problems with one particular photo of mine. Don’t know why – it was the same dimensions and roughly the same size as the others. But I didn’t upload that one and it was fine from then onwards.
I’m pretty sure I’ve uploaded near the maximum of 60 before in one shot before – but this was at my previous place with ADSL2. I’m unfortunately only on ADSL1 at the moment with an upload speed of 128k. My gut feel is that it’s something to do with the time taken to upload or response time, which is related to my connection speed and the number of photos I’m uploading.
For now, I’m happy to find my magic breaking point of ~18 photos. Something for others to think about if they’re having problems!
[Update 26 May 2009]
I’ve noticed that this blog post still gets a lot of hits! I’m not sure whether these techniques work for anyone or not.
Lately, I’ve been having much more success uploading to Facebook if I resize my photos first to a maximum width of 1024 pixels and upload smaller groups at a time. It even works with the Java based uploader!
I think my mistake above, nearly a year ago, was to upload the photos taken directly by my digital camera. With digital cameras commonly having 8-12 megapixels nowadays, the images produced are really too large for viewing on computer screens. The solution is to resize your photo BEFORE uploading. This makes the size of the photo drop dramatically too, and reduces the work that the Facebook uploader would do in resizing the photo. Hope this helps someone out there!
[Update 6 Oct 2009]
I tried again on the weekend to upload some photos to Facebook and it still didn’t work reliably. But then I tried using the Facebook publishing tool in iPhoto, and it worked successfully the very first time! This really leads me to believe it’s the java code in Facebook’s uploading page that is not very robust.
So, if you have a Mac, use iPhoto.