Skip to content

Can't download a file that doesn't exist on the server or locally #206

Description

@mogsten

I keep getting this error

Can't download a file that doesn't exist on the server or locally. (Code: 151, Version: 1.12.0)

I have included the fileKey in the index.js file but can't seem to get access to any image or video based content. Only text based content works properly

Activity

  1. gfosco commented on Feb 4, 2016

    @gfosco
    Contributor

    Can you log the contents of the file object? What does the url key look like?

  2. mogsten commented on Feb 5, 2016

    @mogsten
    Author

    How would I do that?
    I am trying to get a PFFile from the MongoDB Database connected to a Parse Server instance hosted on Heroku
    Is there something that may be causing it not to work?

  3. chriscborg commented on Feb 5, 2016

    @chriscborg
    Contributor

    This happened to me as well when trying to save a PFUser. During this save operation, no file was being uploaded however the user's document did have a link to an image saved on S3. I had to delete the schema and collection and re-create the users for it to start working.

  4. gfosco commented on Feb 6, 2016

    @gfosco
    Contributor

    Does your filename have an extension?

  5. mogsten commented on Feb 6, 2016

    @mogsten
    Author

    All of my files are .png files, I can't download them from Parse with the Parse Server hosted on Heroku and the Database Hosted with MongoDB

  6. gfosco commented on Feb 8, 2016

    @gfosco
    Contributor

    In trying to find out why this is happening, it would be great if you could log or capture a request against your parse-server which returns the file object.

    You can run the server with the environment variable VERBOSE=1, query for the object with the file column, and then check the heroku logs. Can you do this?

  7. topwebtek7 commented on Feb 9, 2016

    @topwebtek7

    I am working on migration parse.

    So I could migrate Parse DB to MongoDB using MongoLab.
    Also I could change parse-server-example;

    add cloud code(for mandrill-api and twilio) in main.js.(this works very well)
    deploy to Heroku.
    However, I have some issues here.

    On iOS development side, when the user logs in, app don't progress any PFObject.

    if I am going to change user's profile(string, boolean, image and so on), I get error message
    [Error]: Can't upload a file that doesn't exist locally. (Code: 151, Version: 1.12.0)

    If I am going to download the user's photo, I get error message.
    [Error]: Can't download a file that doesn't exist on the server or locally. (Code: 151, Version: 1.12.0)

    Also I found a strange issue.
    After migration, I created a new account on my app.(without user's photo)
    First, it seems it works very well

    But If I upload user's photo, connection error occurs.

    What's matter?

    I hope you can help me.

    Thanks

  8. topwebtek7 commented on Feb 9, 2016

    @topwebtek7

    @vioside

    Thanks for sharing how to fix your issue.

    I got same error message if I save PFUser.currentUser.

    However, I am working on migration parse app on app store.

    So the number of users is over 300. I am afraid that I can lost data.

  9. tdunham02 commented on Feb 10, 2016

    @tdunham02

    My solution:

    Save the PFFile as usual, but when saving it to Heroku (MongoLabs), save the file's URL to an NSString field. From there, load the image from the URL with AFNetworking...

    PFFile *image = [PFFile fileWithData:imageData];
    [image saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if (!error) {         
            //Set user data
            user[@"picture"] = image;
            user[@"pictureLink"] = image.url;
            [user saveInBackground];
        }
    }];
    

    Load:

    if (user[@"pictureLink"]) {
        [imageView setImageWithURL:[NSURL URLWithString:user[@"pictureLink"]] placeholderImage:nil];
    }
    

    Not sure if this is the best way, but it works!

  10. mogsten commented on Feb 14, 2016

    @mogsten
    Author

    Cheers tdunham02. It works perfectly for me, but it is a little bit slow, might have something to do with where the Parse Server is hosted

  11. mogsten commented on Feb 15, 2016

    @mogsten
    Author

    I have updated the Parse Server module on my Digital Ocean box and I am still getting the same error. Is there any official documentation that shows us how to completely setup Parse Server from scratch on any hosting provider?

  12. gfosco commented on Feb 20, 2016

    @gfosco
    Contributor

    There's this, and they have an expanded part 2 coming out soon: https://www.digitalocean.com/community/tutorials/how-to-run-parse-server-on-ubuntu-14-04

    If you're still having issues with the latest version, please try to get a clear reproduction steps list and capture any messages. Try to identify exactly which step is going wrong. When you have that, please open a new issue. Thanks. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions