Repository navigation
Can't download a file that doesn't exist on the server or locally #206
Description
Activity
Can you log the contents of the file object? What does the url key look like?
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?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.
Does your filename have an extension?
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
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?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 wellBut If I upload user's photo, connection error occurs.
What's matter?
I hope you can help me.
Thanks
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.
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!
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
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?
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. 👍
- addedtype:questionSupport or code-level questionSupport or code-level questionand removed
on Jul 11, 2021
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