I've had a look up and down the forums for an answer but can't find anything that will expedite this problem.
So i know the workflow is the following:
Get uploaded URL request.
Once that is done. Post to the URL with some data form.
I have tried doing this but get an error stating ' cannot upload file'.
Looks like i can't post any type of data to this URL, as i get the same error. Test Harness works just find and when i use a HTTP Request tester online ,i get the same errors as well.
My question really is:
What are the required headers and parameters for this post?
Is it possible to take a look at the test harness upload feature form source so i can understand the make-up of the request and what is required?
var blob = MSApp.createBlobFromRandomAccessStream("image/jpeg", stream);
var data = new FormData();
data.append("snapshot", blob, filename);
return WinJS.xhr({
type: "POST",
url: gsUploadURL,
data: data
})
.then(function complete(result) {
Thanks.
Best Answer
C
Customer Support
said
over 5 years ago
Hi Yaser,
I've put together a very simple project to illustrate how you can go
about binary uploads with the Javascript SDK, this example uses html forms, but by inspecting the headers you should be able to achieve the same in xhr / ajax. You'll need to fill in
your apiKey and apiSecret. It might be also useful to open the developer console while doing this to watch the debug console throughout the process.
I will also add that i created an event, that uploads a Uint8Array from an image and stores it in a noSQL database. When i open the database it feels really slow. So this being a test, it didn't go so well i reckon. I also experienced some disconnections due to this. I won't be doing this but felt it was worth mentioning.
Y
Yaser Saqib
said
over 5 years ago
Any ideas guys?
Customer Support
said
over 5 years ago
Answer
Hi Yaser,
I've put together a very simple project to illustrate how you can go
about binary uploads with the Javascript SDK, this example uses html forms, but by inspecting the headers you should be able to achieve the same in xhr / ajax. You'll need to fill in
your apiKey and apiSecret. It might be also useful to open the developer console while doing this to watch the debug console throughout the process.
Yaser Saqib
I've had a look up and down the forums for an answer but can't find anything that will expedite this problem.
So i know the workflow is the following:
Get uploaded URL request.
Once that is done. Post to the URL with some data form.
I have tried doing this but get an error stating ' cannot upload file'.
Looks like i can't post any type of data to this URL, as i get the same error. Test Harness works just find and when i use a HTTP Request tester online ,i get the same errors as well.
My question really is:
What are the required headers and parameters for this post?
Is it possible to take a look at the test harness upload feature form source so i can understand the make-up of the request and what is required?
Thanks.
Hi Yaser,
I've put together a very simple project to illustrate how you can go about binary uploads with the Javascript SDK, this example uses html forms, but by inspecting the headers you should be able to achieve the same in xhr / ajax. You'll need to fill in your apiKey and apiSecret. It might be also useful to open the developer console while doing this to watch the debug console throughout the process.
I hope this helps, kind regards,
- Steve
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstYaser Saqib
I will also add that i created an event, that uploads a Uint8Array from an image and stores it in a noSQL database. When i open the database it feels really slow. So this being a test, it didn't go so well i reckon. I also experienced some disconnections due to this. I won't be doing this but felt it was worth mentioning.
Yaser Saqib
Any ideas guys?
Customer Support
Hi Yaser,
I've put together a very simple project to illustrate how you can go about binary uploads with the Javascript SDK, this example uses html forms, but by inspecting the headers you should be able to achieve the same in xhr / ajax. You'll need to fill in your apiKey and apiSecret. It might be also useful to open the developer console while doing this to watch the debug console throughout the process.
I hope this helps, kind regards,
- Steve
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics