Create .Zip file of Images - ios

I'm wondering how I can create a .zip file with images in it. Is there any way to do this?

You can do that by calling addAttachmentData:mimeType:fileName: on the MFMailComposeViewController - if you already have the zip file.
If your question includes creating the zip file, unfortunately that is not possible with a few method calls in iOS. You would need to use a third-party library for this, e. g. objective-zip.

yes, it is possible go here to find out:
Class Refrence
look for the add atachment method.

Related

Upload file to the specified path (OneDrive)?

I prefer iOS code but the solutions in other languages may refer to this question too.
I use LiveSDK to access to OneDrive. Here is a link to the example which uses upload action (onClickUploadButton:)
But I can't understand how to specify the custom upload path - only default "me/skydrive" works. How do you solve the problem when you need to upload a concrete file to a concrete path which may not exist? Should I create all the folders separately and/or get their IDs to place a file exactly into them?

How to share a bunch of files at once in iOS

I need to share some data, e.g. two images, to other apps like dropbox or gdrive.
Some recommend using UIActivityViewController but there's no option for mimetypes and other recommend using UIDocumentInteractionController but this seems only be suitable for single files...
Does anybody know about the right way and/or can provide some example in swift?
Edit:
UIActivityViewController seems to be the right way and NSURL.fileURLWithPath(filePath) provides the content.
But what about files stored on a server? Those must be downloaded at some point during share process (e.g. after choosing dropbox). How can I achieve this? I tried with a customized UIActivityItemSource with no luck.
Thanks.
Take a look at the Apple doc for UIPasteboard.
Using UIActivityViewController is the right way.
I had to provide my files wrapped in a subclass of UIActivityItemProvider.
Overriding item()-function for downloading and providing my binary content.

How to download a Dropbox share linkage (aimed at a zip file) to local

I have following question and want help regarding that.I'm using Dropbox iOS SDK.
Is it possible to download a Dropbox share linkage (aimed at a zip file) like https://www.dropbox.com/s/m2o28nls8m8uyx9/FacebookAPI.zip.
I think I could use HTTP post method. However, the receive MIME Type is text/html rather than zip type.
Thanks
i think you can try this:
change your sharable link to:
https://dl.dropbox.com/s/m2o28nls8m8uyx9/FacebookAPI.zip?dl=1
it works on my file.
For me this works
Replace 'https://www.dropbox.com' with 'https://dl.dropboxusercontent.com'

How can we write Structures in file?

I am new to IOS programming. I want to write a C style structure into file and retrieve back.
I am able to write string into file after getting Document directory path. But how to write a structure in that file. Can anyone help?
You'd likely be most interested in the NSCoding protocol, as well as the Creating and Extracting Archives and Encoding and Decoding Objects in the Archives and Serialization guide.
Normal C way of I\O operation worked well, however the to write file in particular location we need permission.

Embedding "com.apple.ibooks.display-options.xml" file into epub

I want to add the com.apple.ibooks.display-options.xml file which is described in the ibooks documentation for publishers.
I am using sigil to create my books but i can't add this file within my epub book file.
Can someone show me how to do it?
As far as I have been able to work out, you can not add it with Sigil. Even once it is in Sigil, you can not see the contents of the file; you are only able to see the file is there. Take a look at some of the example projects in this post.
Open the epub file with 7zip, then add the com.apple.ibooks.display-options.xml. That should do it, it did work for me.

Resources