I have been using Parse for a very long time. Today I installed Parse Server locally ( Using cloned repo from heroku and also using mongoDB locally ), and tried to upload an image. The Swift code i used to upload image.
let testObject = PFObject(className: "Test")
testObject["foo"] = "bar"
if let imageData = UIImagePNGRepresentation(UIImage(named: "1")!)
{
testObject["image"] = PFFile(data: imageData)
}
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
if let properError = error
{
print(properError)
}
else
{
print("Object has been saved.")
}
}
I got this error message.
[Error]: Could not store file. (Code: 130, Version: 1.12.0)
Error Domain=Parse Code=130 "Could not store file." UserInfo={code=130, temporary=0, error=Could not store file., NSLocalizedDescription=Could not store file.}
After that i tried to upload an image to Parse.com by changing some settings in the app. By using the same code to upload image to server. Then i got this error message.
[Error]: Could not store file. (Code: 130, Version: 1.12.0)
Error Domain=Parse Code=130 "invalid file upload" UserInfo={code=130, temporary=0, error=Could not store file., NSLocalizedDescription=invalid file upload.}
After that i installed Parse Server on Heroku and connected MongoLabs, and tried to upload the same file with same code, i got error message saying that "The Internet connection appears to be offline." when there is proper Internet connection.
After that i tried to upload a very small sized image to the same Parse Server hosted in Heroku, then it worked. The file uploaded and in MongoLabs. And I saw that file saved with a name "hashValue_file_bin".
I was looking for this file in project directory, but could not see it. Where i can see these kind of files ? Are they directly uploading into Database or using a directory structure.
Also please help me out why this uploading not works ??