How to Upload an image in RIM Blackberry - blackberry

I want to upload image in RIM Blakcberry. I have url like
http://server/myproject/json.php?action=image
and parameters
imageField= binary / byte data
imagePath= "userImage"
I refer this link.
But i unable to upload an image. Does anybody know?? Very much thankful..

Refer to the "Problem: How to upload file to server" thread to know about uploading file over server.

Related

SoundCloud uploads from iOS have incorrect download file name

I'm using the iOS API to upload wav files to SoundCloud. There's no problem with the upload, however, when I attempt to download the file on the SoundCloud website the file name is always "unknown". When I upload the same song from my computer the file name matches the title.
There's nothing in the API reference that indicates you can set the download file name, so I assume it's generated from the title. Is this correct? Is there any additional metadata that needs to be set to make this work?
Any insight would be appreciated. Thanks!
When downloading a sound file from the SoundCloud website, the filename the user sees is the one used by the original uploader when they uploaded the sound to SoundCloud.

Path to image from iOS Gallery Xamarin

I was following this tutorial http://developer.xamarin.com/recipes/ios/media/video_and_photos/choose_a_photo_from_the_gallery/ and I can get the path for a video just by doing
mediaURL.Path
but with an image it returns something like
"assets-library://asset/asset.JPG?id=2A456415-B1AE-414A-9795-A0625K768EBD&ext=JPG"
and I can not use it to upload to my server because using FileInfo("imageLocaltion") will not find the file.
So with urls like the above how can I access the "real" file path?
See "display image from URL retrieved from ALAsset in iPhone" - the same mechanisms apply to Monotouch:
MonoTouch: Getting an Image out of ALAssetsLibrary.AssetForUrl

NSURLSession Background File Upload using Bound Streams

History:
I am working on a project for which we need to support:
Background Upload of files using NSURLSession.
The server expects file to be uploaded using Content-Type: multipart/form-data
Previously, I was using NSURLConnection with bound pair of Streams as depicted in this Apple Sample.
Now, I wish to follow similar approach with NSURLSession(Background Session) by using uploadTaskWithStreamedRequest:.
I have written a small stand-alone iOS Sample + a PHP server to validate my concept.
Problem: Everything works if app stays in foreground, but if during upload I press the home key, the upload fails after some time with error:
Domain=NSURLErrorDomain Code=-997 "Lost connection to background transfer service"
Also a little before the upload fails the Write/Producer Stream's NSStreamEventEndEncountered is encountered.
Note: I know the work-around where I can write whole HTTP Post body to a temp file and use NSURLSession's file upload API instead. But above is more appropriate if I can make it work.
Question: Can anyone guess what could be possible reason for the upload getting failed?
Sample Code: I have uploaded the iOS Sample Code + PHP Server Code to drop box. Here is the CODE
Thanks!
You can't upload streamed tasks using Background Configuration. I successfully upload data only in two cases:
Download task with data stored in request body.
Upload task from file. In that case you will not receive response body.

How to upload photo to image hosting website programmatically?

Is there any way to upload photo programmatically from phone to any photo hosting website(any suggestion for a photo hosting site?)? I need to get the URL only for the uploaded photo to use it on my app. How do you do that?
You can use a service that offer some API like imgur.
You can download the library and see a snippet of code to implement the upload, here on the imgur github page.

iOS tweet image - Can I get the image url before upload?

I want to be able to share images from my app on twitter/facebook/email etc..
There's probably hundreds of different ways to do this which is quite simple.
However what I need/want to do, is allow the images to be opened by other people straight into my app (If they have it installed).
So I have a url scheme so a url will open my app with an image like this:
myurlscheme://image?url=http://imageurl.com
The problem I have, is the process for uploading the image, but adding my url scheme to the beginning of the url.
If I could know the url twitter/facebook is going to use before I send the tweet, I could add my url scheme to the front of the image url and put it in the tweet. I'm guessing this might not be possible though.
Another thought is to upload the image to another service, get the url, then compose and send the tweet. Are there any suitable services for doing this? (Preferably free services) I dont really want to have to host the images myself.
Thanks
1) I don't see how you plan on conjuring an image URL before you upload the image - that is a chicken/egg situation. I would recommend taking a look at an actual image URL after you upload it to facebook, twitter, etc and try to figure out even one character of what it would be for the next image you upload. Regarding twitter specifically the image URL is also going to vary depending on what upload service is being used.
2) regarding uploading the image and getting the URL why not look into tapping into the flickr API?

Resources