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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:55:48+00:00 2026-06-13T10:55:48+00:00

I’ve been at this all night and its driving me nuts, I have an

  • 0

I’ve been at this all night and its driving me nuts, I have an application which is called by openURL calls from Safari. Safari sends me the fileURL and copies the file in to Documents/Inbox and I then want to read the contents of that file in to a string. However after trying many varied ways of locating / accessing the file …… my app still says the file doesn’t exist.

So I get sent the fileURL from Safari like this ..

file://localhost/Users/plasma/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/EE3A1801-98CF-4C7A-8ED1-639A81316B1C/Documents/Inbox/HereIsYourFile.txt

If I browse to this path in the terminal I can confirm that is the location and the file exists.

macbook:Inbox plasma$ pwd

/Users/plasma/Library/Application Support/iPhone Simulator/6.0/Applications/EE3A1801-98CF-4C7A-8ED1-639A81316B1C/Documents/Inbox

macbook:Inbox plasma$ ls
HereIsYourFile.txt

I put this path in a String called receivedURL but trying to read the file just gives an empty string and an error 260.

NSString *myFileContents = [NSString stringWithContentsOfFile:receivedURL
                                             encoding:NSUTF8StringEncoding
                                             error:&error];

This infers the file is not there, so I tried proving that it exists in my app …

        NSFileManager *filemgr;
        filemgr = [NSFileManager defaultManager];

        if ([filemgr fileExistsAtPath:receivedURL ] == YES) {
            NSLog (@"File exists");
        } else {
            NSLog (@"File not found");
        }

Its says it doesn’t exist!!!! I can see it .. its there, so why can’t my app. I read on the documentation page Here that files in this location should be visible and readable by the application.

Any help on accessing this file would be greatly appreciated.

Thanks In Advance

Plasma

  • 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-13T10:55:49+00:00Added an answer on June 13, 2026 at 10:55 am

    How do you create receivedURL from the NSURL given to you when the app is launched? You should be doing this:

    NSString *receivedURL = [url path];
    

    Make sure that receivedURL doesn’t have the file:// at the beginning.

    Another option is to use the NSURL to load the string from the file:

    NSString *myFileContents = [NSString stringWithContentsOfURL:url
                                             encoding:NSUTF8StringEncoding
                                             error:&error];
    

    instead of converting the URL to a file path.

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
This could be a duplicate question, but I have no idea what search terms
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.