File upload from Appgyver

Thanks Mark, yes I’ll use the File API then and I can find the path on my phone no problem. So then do I use the copy file API? I’ve tried this just using a basic image file already saved in my web folder on backendless and get this error:

{
“code”: 6007,
“message”: “The specified resource was not found”,
“errorData”: {}
}

Here are the URL’s I’m using:
From: https://backendlessappcontent.com/'app id’/‘rest key’/files/web/images/Gym.jpg
To: https://backendlessappcontent.com/'app id’/‘rest key’/files/web/images/Gym2.jpg

You can use the “Copy File/Directory” when you need to copy a file that already exists in the Backendless file storage to another directory.
Please use the following doc to see the semantics for the “from” and “to” arguments:
https://backendless.com/docs/rest/file_file_copy.html

Regards,
Mark

Ok but if I want to upload a local file on my phone to backendless what File API function would I use?

You would use this:

https://backendless.com/docs/rest/files_file_upload.html

Haha thanks, I found that just as you were replying. Sorry and thank you Mark.

Getting closer…

Getting error:
{“code”:8002,“message”:"Could not parse request with message: Missing boundary header, status code 400](File Uploading error. {"code":8002,"message":"Could not parse request with message: Missing boundary header, status code 400)

Which I see another post on this and your response, but I still dont understand what needs to change.

My REST call looks like this:
https://api.backendless.com/'app id’/‘rest api’/files/web/images/image.jpg?overwrite=true

and I’m passing it {fileURL: pageVars.imageUpload} where the imageUpload is a path (file:///var/mobile/containers/etc/etc) to the image file.

How close am I?

Ok I found the multi-part/form data piece that should form the request body.
Trying to figure out how to send an image in multi-part/form data now… any suggestions welcome!

Hi, @Joel_Maclean

After selection a mandatory header (multi-part/ form) you need to select in the request body the form-data type and as a value the full path to this file on your device.
As example my curl looks like this:

POST https://api.backendless.com/<application-id><REST-api-key>/files/Exapmle.png \

--header 'Content-Type: multipart/form-data' \

--form '=@"/path/to/file"'

Regards,
Marina

Thanks Marina, but I’m having trouble figuring out where to put this information.

I have a REST URL, a header, and a payload. Where do I put the --form ‘=@"/path/to/file"’ piece?

Hi Joel,

I think that question would be better addressed to AppGyver’s support. We can assist with backendless api, our own UI Builder, but when it comes to third party tools, we cannot provide support for them.

Regards,
Mark

@Joel_Maclean - did you have any luck with this? I am getting nowhere at the moment! I am going thru the appgyver documentation and forums and no such luck

Just curious, guys…is AppGyver support pretty much non existent?? @sim_sim @Joel_Maclean ?

Yea no progress @sim_sim , I posted in Appgyver forums to ask for paid help and can’t seem to get anything going. A few guys replied but no one responds outside of the forums.

@mark-piller basically yes, they warn the users that its not supported and that they rely on community support. Trouble is the ‘community’ is very small

@mark-piller I do think it complements your product quite well. I did try to use your front end but the functionality has a ways to go to catchup to Appgyver, also Appgyver has a build component that allows us to build packages to publish in the app stores and web app servers.

Here is a screen shot of where you configure an API call, as you can see there’s an option to set a header, but not sure where to go with the --form piece @Marina.Kan mentions. Happy to entertain any suggestions here :pray:.

Looks like it clearly falls behind our UI system in the file upload area…:wink:

Is it just the ability to build a native app that attracts you, @Joel_Maclean ? I would like to understand where we fall short from your perspective.

Thank you for the feedback, it does help us build a better product.

Regards,
Mark

Haha touche @mark-piller. And agree.
The native app (ability to run local storage), and charting (google charts plugin) I’d say are the main differentiators. I essentially built an mvp on backendless’ front/back end and had to switch to appgyver for a front end when I discovered the charting options. I’d be happy to beta any features you guys are working to help refine/grow your product.

Do we need to complete the missions to use the Backendless API for the free version?

You can you use backendless api at any point as long as the app is not suspended. Missions can be used to unlock the Springboard plan

thanks !

In the documentation for the API it shows the format using curl, but is there a way to reflect how that format translates to a web call? Like where does the --form piece go? can it go in the URL as a parameter?

curl -H Content-Type:“multipart/form-data” \
–form upload=@test.txt \
-X POST \
-v http://api.backendless.com/XXXX-XXXXX-XXXX/ZZZZ-ZZZZ-ZZZZZ/files/txtfiles/test.txt