Backendless Support
 
Waiting for user's response

Codeless: Upload File Block - Data in which format?

Hi all,

I am trying to create a file in one of my codeless API functions, and noticed that the create file block expects the "file content" parameter to be a string.

My question is in what format is the file system expecting this string to be? Base64?

Renato

21d1489092f4ac7ef46db89859208e67

Leave a Comment

Comments (13)

photo
1

Hi Renato

This parameter is corresponding to the third parameter in the saveFile method which is expected to be a byte array. But currently the value will be cast to the method as String. This is unexpected behavior and the block will not work. I've opened internal ticket to fix this issue. We'll report back soon when issue will be fixed. Thanks for reporting

Regards Anton

photo
1

Hi Renato

We've fixed the "Create File" block, and released the changes.

Regards, Vlad

photo
1

Hi Vlad,

Thanks!

Quick question - how do I use it? On the surface, the block seems to still be wanting a string ... how do I pass data into it?

Also with that, what datatype should I be using (when defining type on a service method)? String, Array, "Any Object"?

Renato

photo
1

Hi Renato,

We've improved the block, and will release it asap

You can create file from:

- plain text (input type: String)

b17def7e0989153decc7c6f4bfd45ec5

0a6c810c16f618dafd90337ba4be016f

- base64 string (input type: String)

b17def7e0989153decc7c6f4bfd45ec5

ba6ebb8775a81dc18ceece3958e359dd

- bytes array (input type: Array[Number])

ad4f534d3aa074091845b0a2204fc243

27e50924bc947b94997dc383962b7701

Regards, Vlad

photo
1

Thanks Vlad, that is fantastic! I will wait until the next release to give it a go!

Renato

photo
1

Hi guys, just wondering if there is an ETA for the next release?

photo
1

Hi Renato,

It should be early next week.

Regards,

Mark

photo
1

Thanks Mark!

photo
photo
1

Hi Renato

We've released the changes, please check this out

Regards, Vlad

photo
1

Hi Vlad, looks to be good - I was able to create a file with a base64 string.

However, a bunch of my blocks were missing and forced me to re-create them. This is probably to be expected with the create file block, but some other simpler blocks (like the create string block) were missing. Is this to be expected when there are changes?

Not sure if its related to recent changes, but I also now get a bunch of errors when simply opening one of my services:

  1. "Cannot read property 'x' of undefined"

In one case, there seems to be an issue around the "to title case" block and the associated code that's generated.

Another is "getName" .. which I'm sure is not a function I created, and doesn't even appear in the code window of the service that the error came up on.

I've attached screenshots.

Thanks,

Renato

photo
1

Hi Renato

Sorry for the delay,

Do you still have the problems, if so, please provide your appId I'll try to investigate it.

Regards, Vlad

photo
1

Hi Vlad,

Still seems to be some odd errors going on. App ID is A324EB2B-1BF5-EB0A-FF36-62F47D198E00, and I seem to keep seeing the inconsistencies when opening service methods in the "Registration Service" codeless svc/model.

Thanks,

Renato

photo
1

Missed blocks - please check this out, it should be fixed

textToTitleCase - has been fixed and you can get the changes with the next release

photo