Hello, I've been trying to upload snapshots to some REST endpoint but the files aren't getting sent over.
Here is my code: https://github.com/sabmah/BrightSign/blob/master/snapshotUploaderPlugin.brs
Both POST and PUT is not working.
Hello, I've been trying to upload snapshots to some REST endpoint but the files aren't getting sent over.
Here is my code: https://github.com/sabmah/BrightSign/blob/master/snapshotUploaderPlugin.brs
Both POST and PUT is not working.
Hi Sabin,
You could try the GetFailureReason() function, to get more insight about the failure reason
GetFailureReason() gives empty result
Try to print responseCode right after
responseCode = xfr.PostFromFile(filePath)
You may have to convert from Integer to string...
You can run the PostFromFile() directly in the debugger, and get a better sense of possible latency, timeouts, etc...
Also, for real life applications the Async function may be more suitable.
AsyncPostFromFile(filename As String) As Boolean
Uses the HTTP POST method to post the contents of the specified file to the current URL. Events of the type roUrlEvent will be sent to the message port associated with the object A False return indicates that the request could not be issued and no events will be delivered.
I get the following response as expected. My REST endpoint isn't seeing any files coming in the body.
@snapshotUploaderPlugin Response Code: 400
The requested URL returned error: 400 Bad Request
Using the same method, can you upload with a tool such as CocoaRestClient or equivalent?
Does your REST API require authentication?
Yes, I can use POSTMAN to upload the file. There is no authentication. The Status Code is 400 Bad Request.
I did a trace log on my back end REST API and the file count is 0
I finally fixed this issue.
It turned out Brightsign (AsyncPostFromFile()) sends the file as binary even though I set Content-Type="multipart/form-data". So, I had to change my backend REST API (.NET WEB API) to read content as binary instead of looking for multipart/form-data
Thanks for all the help guys.
hi sabin, I want send to server the screen shot, I need create a PHP in the server and use your plugin?? thanks
I am not able to figure out how to upload the plugin to a brightsign player. so that the snapshots can be uploaded to a rest api while presentations are being played. Can anyone help ?
Can't find what you're looking for?
Contact support