开发者

iTunes file sharing - how to upload different folders?

i want to use the "file sharing" feature in my app. I want to create a photo-app which has no content when the user starts it. Therefore the user can select an image-folder on his mac or pc. After that and starting the app on his iphone or ipad, all the content of his image-folder will be viewable.

I think its only possible to add simple files开发者_如何学Go to my app - not content folders, right? Any ideas how i could do this?

Thanks for your time and help.


On your mac, rename the folder to folder.pkg.

You can now add folder.pkg to the documents for your app using iTunes File Sharing.

Once folder.pkg has been added, rename it to its original name.

Not sure how to do this with iTunes on a PC.


You cannot upload folder to the app.

one way to do so

create .zip file of that folder and upload. extract that zip file from app.

checkout this project, It has a code to extract zip file.

https://github.com/ZipArchive/ZipArchive


I found that using iTunes 12, and iOS8, I can now ADD folders to an apps Documents folder using iTunes File Sharing. Previously it was only possible to add single files.


It is indeed possible to add a folder to and App's File Sharing space using iTunes version 12+. However, the iTunes upload button will not work for this, because its file selection interface insists on plain file selection only, excluding folders. The way which works is to drag-and-drop a folder from your PC to the iTunes File Sharing window.

Since the iTunes interface for handling file sharing is very poorly designed, is is worth recalling the tricks that you can use to perform operations on the File Sharing space, that iTunes does not provide a button for:

  • Rename a file or folder: click it once, wait for a couple of seconds, and click it again. This will replace the name with the renaming edit box
  • Delete a file or folder: select it, then hit the "Del" key on your keyboard
  • Upload a folder: drag-and-drop it from your computer copy

It remains impossible to directly see or alter the contents of a File Sharing folder in iTunes. My workaround for doing this is the following:

  1. Download the folder to the computer
  2. Make any desired change to the folder tree on the computer copy
  3. Delete the File Sharing copy of the folder (or, optionally, rename it to something like folder.old for safety)
  4. Upload the modified folder from the computer, using drag-and-drop
  5. (optionally) Delete the safety copy in File Sharing, after verifying that the App works fine with the newly uploaded version of the folder

I hope this helps


I was not able to drag-and-drop a folder from my PC (Windows 10). But I found a free application called iFunbox that allowed me to copy a folder to an application's documents.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜