Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse backend new Error for uploading files - Error: File name must be a string - PFFile

I'm building an IOS app and using parse.com as a backend. All of a sudden, today I am getting this error - Error: File name must be a string without any other explanation. I'm certain the file name that I am using is a string. I haven't changed any of the Native IOS code so it must be a new Parse issue. The only difference - today I updated my account to the new pricing model on Parse, wondering if that's related?

// Code snippet 
NSString *fileName = @"test.mov"; // Also tried just @"test"

PFFile *file = [PFFile fileWithName:fileName data:fileData]; // NSData - 286553 bytes

[file saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
// Break point right here - this is where the error occurs.
like image 494
kevin Avatar asked Apr 30 '14 22:04

kevin


People also ask

What are the arguments required for upload_file?

Per the docs, the function upload_file has three required arguments: filename, bucket, object. All of them are strings. Your fp object is not a filename, and it's not a string.

Why are my encoded files not working properly?

Another cause could be the presence of non-standard characters that aren’t usable. For example, it may be necessary to save a file with UTF-8 encoding in order for that file to work properly within a company’s platform. Attempting to import data with different encoded files would simply not work.

Why is my CSV file not uploading?

Another key import error that pops up when uploading a CSV file is related to matching. This could be columns that don’t match expected field names caused by different values than expected, field names not on the first line, or simply the complete absence of column names.

Is the FP object a string or a filename?

All of them are strings. Your fp object is not a filename, and it's not a string. Pass the filename to the function instead. Show activity on this post.


1 Answers

NEWS:

ALL should go to: https://developers.facebook.com/bugs/622479264497355/?comment_id=1426426400945705

And post your account email to Hector Ramos.

Update2: This has been fixed and is preparing for a deploy.

The problem is: Basically, if you are currently using LESS than 1GB of data storage (for example, I'm using 679MB), instead of correctly calculating that I'm using (679 / (1024MB * 20)) = 3.3% of the quota, its calculating it as 679/20, which gets the result of 3395%. Parse, if you see this, PLEASE... its really just a few lines of code.. please resolve this ASAP!

like image 71
Marckaraujo Avatar answered Oct 08 '22 12:10

Marckaraujo