Communication Of iPhone and Google App Engine - iphone

How can I get a pdf data (stored in datastore as blob) from iphone if i make a request to google app engine?
When I use
self.response.out.write('asadasd');
in google app engine code
I can see this 'asadasd' in iPhone.
But i don't know how to set this communication so that i can get a pdf data from i phone.
Thanks in advance!

If I understand corretly, you want to send an pdf file to a webapplication, right?
I think it would be a solution to base64 code the binary data of the pdf on the iphone (that comes from your blob) and then send it via http post to the webapplication.

You should set the proper headers before writing to the output stream:
self.response.headers['Content-Type'] = 'application/pdf'
self.response.headers['Content-Disposition'] = 'attachment;filename=filename.pdf'
self.response.out.write(...)

Related

How to convert audio binary on server from iPhone POST request?

I have a working POST request that will send a CAF audio file (recorded on the iPhone with AVAudioRecorder) to a web server -- the request itself is structured similarly to Send an audio FILE and JSON string in iOS.
The server correctly receives the file, but I'm having trouble converting it into a format that will play directly in a browser. In addition to every audio/iPhone/server post I could find on stack overflow, I've looked into ffmpeg and HTML5 audio as well, but couldn't find clear instructions on how to convert the received audio binary to a browser-playable format. Essentially, I need to understand how to accomplish Arun's server-side suggestion here.
I know that Audacity, Soundbooth, etc. will allow you to use the raw data and save it as another format, but I need this to be done programmatically on the server. If there are any suggestions they would be very much appreciated! Thank you.

getting data from server and store in the iPhone

i want to develop an iPhone app where the app downloads data (say audio clips) from a specified server and stores it locally on the device.
then the app should use the data stored in the device rather than stream it from the server.
could anybody give me the guidelines as to how this can be done? tutorials and samples also appreciated. Thanks :)
The easiest way to play files from the internet is to use -[AVAudioPlayer initWithContentsOfURL:error:]. If you want to make sure that the whole file is downloaded, I think your best bet would be to download the file using NSURLConnection (see the URL Loading Guide) and then using -[AVAudioPlayer initWithData:error:].
Look into ASIHTTPRequest, you will find it much easier to fetch large chunks of binary over the web asynchronously than if you try to code everything yourself.

iphone: coding a data compression or zipping agent?

I'm creating a simple service for uploading photographs from an iphone to a web server.
However, before the requests is sent, I want the app to compress the pictures (custom format or otherwise) in the background before sending it.
Any pointers on how I could go about doing this?
Check out the NSDataCategory posted to CocoaDev. It does exactly what you're looking to do.
http://www.cocoadev.com/index.pl?NSDataCategory
I use ziparchive to unzip content downloaded from a server. It also has functionality to create zip files on an iOS device and might be what you are looking for.
http://code.google.com/p/ziparchive/

how to get data from web server to iphone or ipod

I'm quite new in iPhone development and I need to develop an app.
I must get mp3 data from a web server, which provides a simple saving the mp3 in my app document or folder
and use it in an application, which should also dislpay a table with rows like:
song1
song2
song3
But at present I don't know at all how to get this web page, parse it and store into an array in the application.
Please do you have any suggestion / hint / sample code ?
Thank you in advance,
There is a tutorial on the apple developer site on how to make a http request and receive data here. Should get you going on how to fetch the web page.
For parsing you can use the NSScanner or a XML/HTML parser library like TouchXML depending on your needs.
I used web services to communicate with web server, the following tutorial helped me a lot.
http://icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/
I was able to send and retrieve binary content using web service but I had to encode it first to be able to send it through Soap request and decode back Soap Response.
Hope that can help you,

Creating multipage PDF in iPad

I am developing an application in which i have to create multi page PDF and email such PDF. The content which is to be converted to PDF contains text as well as some images. I have seen some posts regarding this, but could not glean too much from it. Will be greatful if any one can guide in this.
Thanx, regards.
You could take a look at docmosis which has a cloud-based document generator. It can generate PDFs and stream them back to the iPad or send as email. You upload a template to the cloud using the Docmosis web site, then you can generate documents from your iPad by sending a request (with data, images etc) to the Docmosis cloud.