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 6235141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:37:07+00:00 2026-05-24T10:37:07+00:00

Possible Duplicate: iPhone Mobile Safari File System Access I want to open a locally

  • 0

Possible Duplicate:
iPhone Mobile Safari File System Access

I want to open a locally saved image in Safari through my app.

When my app loads, I place an image in “/Users/username/Pictures/xxx.jpg”. If I open Safari directly and enter “file:///Users/username/Pictures/xxx.jpg” or “file://localhost/Users/username/Pictures/xxx.jpg”, the image opens in the browser.

But if I try to open Safari through my app, neither Safari, nor the image opens. Following is the code I use to open Safari through my app.


NSString *str = [NSString stringWithFormat:@"file:///Users/username/Pictures/xxx.jpg"];
str = [str stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSURL *url = [NSURL URLWithString:str];
if (![[UIApplication sharedApplication] openURL:url])
NSLog(@"%@%@",@"Failed to open url:",[url description]);

A point worth mentioning is that if I open an HTTP URL, say http://www.google.com, the app opens Safari with the URL specified.

I’m trying this on Simulator and have not saved the image in the my apps folder just to make sure that the image is not sandboxed. Even if I place the image in my apps folder, I get the failure message.

Please note: I’m not using a UIWebView as it will defeat the Business Requirement.

  • 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-05-24T10:37:08+00:00Added an answer on May 24, 2026 at 10:37 am

    You can’t access Local files by opening the Safari Browser because it is sandboxed and can not access files included in your App Bundle or Directory. You may need to change see if you can change the business requirement and use a UIWebView

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

Sidebar

Related Questions

Possible Duplicate: Save Youtube video to iPhone in the app I want to download
Possible Duplicate: iPhone app without AppStore My boss had an idea to develop an
Possible Duplicate: Starting iPhone app development in Linux? Is there a way to use
Possible Duplicate: Make iPhone app paid version replace free version on install from app
Possible Duplicate: Setting iphone to vibrate and setting iphone back to sound via app.
Possible Duplicate: Procedure to submit iPhone application to App Store? what are the Steps
Possible Duplicate: iPhone - file properties Hi all. i m creating an application which
Possible Duplicate: Using SSL in an iPhone App - Export Compliance I am in
Possible Duplicate: @font-face is deprecated on the iPhone version of Safari. What are my
Possible Duplicate: iPhone development on Windows Hello friends, I Want To Know that Is

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.