Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:37:06+00:00 2026-06-09T01:37:06+00:00

For example if I have an XML file (exported from another app, so I

  • 0

For example if I have an XML file (exported from another app, so I have no control over the contents) that references images in different folders to the XML file, I am not able to read the images until the user has browsed to them using my app.

I can get around it by making them browse to a higher level folder (even browsing to “/”), but it seems a bit crap to be telling the user “I can’t access /path/to/file, can you please browse to it now, so I can open it?”

Are there any better solutions to this? Isn’t there some way to show a prompt like “AppX is trying to read from /Users/UserX/FolderX, will you grant permission?”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:37:09+00:00Added an answer on June 9, 2026 at 1:37 am

    See my question and answer here: App Sandbox: document-scoped bookmark not resolving; not returning any error

    I’m embedding collection-scoped bookmarks into my XML files.

    Update

    Given the specification that you have no control over the input XML format, the only way to get access for your app to a file specified in the XML is by having the user select that file or one of the file’s parent directories in an NSOpenPanel. If the XML contains multiple file references, you can have the user grant access to a directory that contains all of them.

    There is no way around asking permission, since that would defeat the purpose of sandboxing. If your app could get around the user’s direct permission, so could malware. Once given access, though, you can create a security-scoped bookmark to each file so you don’t need to ask the user for permission multiple times.

    Update 2

    Answering the question in your comment, you can make the dialog easier for the user with the following:

    [openPanel setMessage:@"Click 'OK' to allow access to files contained in the selected directory"];
    [openPanel setDirectoryURL:[NSURL fileURLWithPath:pathFromTheXMLFile]];
    

    Here’s the documentation on NSSavePanel (NSOpenPanel inherits from it, and the properties above are defined there).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a xml file on a server that look for example like this
If I have an XML file that looks like this: <properties> <property> <picture>http://example.com/image1.jpg</picture> <picture>http://example.com/image2.jpg</picture>
For example I have file config.xml in that file I have following xml content
I have xml file that defines some preference screens like the following example <PreferenceScreen
Suppose I have xml file with contents like this: <example name={name}/> Is it possible
I have the following in an XML file: <entry> ... <link href=http://www.example.com/somelink /> ...
I have an xml database that contains films, for example: <film id=5> <title>The Avengers</title>
I have an XML exported from Oracle DB, which will be downloaded into my
For example, we have xml file with this format: <A> <B> <C></C> <D></D> <D></D>
I have an XML file that I need to transform using an XSL script.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.