Have a look at this Stack Overflow answer 
<http://stackoverflow.com/questions/23248576/no-access-control-allow-origin-header-with-resumable-upload/25536248#25536248>
 
for more details. This is an issue specific to the JSON API. In your case, 
does the 'Origin: ' header differ from the initial POST and subsequent PUT 
requests?

On Tuesday, February 28, 2017 at 11:40:33 AM UTC-5, Richard Cheesmar wrote:
>
> Update:
>
> Ok, so after much deliberation about how to simplify the approach, finally 
> I get a method together that I think I can live with, but there is still 
> one problem.
>
> What I am doing to upload a video from the client direct (via localhost) 
> is:
>
> 1. I generate an access token and build a POST request for the initial 
> upload request to the JSON api.
> 2. I make the POST call which successfully returns a location.
> 3. I return the location to the client via a json object
> 4. I make the PUT call in the returned location which starts the upload - 
> this is done using standard ajax via Jquery.
> 5. The video is actually arriving at the bucket but the ajax call returns 
> with an error at the end of the upload
>
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading 
> the remote resource at https://
> www.googleapis.com/upload/storage/v1/b/my-bucket/o?uploadType=resumable&name=test-vid&upload_id=generate-id.
>  
> (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
>
>
> Seems strange to me as the video actually gets to the bucket...
>
> For the time being I have added the * to CORS headers on the bucket by 
> using the Google Cloud shell and some instructions from here 
> https://bitmovin.com/faq/how-do-i-set-up-cors-for-my-google-cloud-storage-bucket/
> and this all seems fine. Well it must be otherwise the PUT wouldn't put 
> the video, if the CORS headers were not in place.
>
> I have no idea why this is, can someone enlighten me?
>
>
> On Monday, February 20, 2017 at 6:47:26 PM UTC+3, Richard Cheesmar wrote:
>>
>> I am using the standard python app engine environment and currently 
>> looking at how one goes about uploading multiple large media files to 
>> Google Cloud Storage (Public Readable) using App Engine or the Client 
>> directly (preferred).
>>
>> I currently send a bunch of smaller images (max 20 - between 30 and 100k 
>> on average), at the same time directly via a POST to the server. These 
>> images are provided by the client and put in my projects default bucket. I 
>> handle the requests images using a separate thread and write them one at a 
>> time to the cloud and then associate them with an ndb object. This is all 
>> fine and dandy when the images are small and do not cause the request to 
>> run out of memory or invoke a DeadlineExceededError. 
>>
>> But what is the best approach for large image files of 20mb+ a piece or 
>> video files of up to 1GB in size? Are there efficient ways to do this from 
>> the client directly, would this be possible via the Json api ,a resumable 
>> upload, for example? If so, are there any clear examples of how to do this 
>> purely in javascript on the client? I have looked at the docs but it's not 
>> intuitively obvious at least to me.
>>
>> I have been looking at the possibilities for a day or two but nothing 
>> hits you with a clear linear description or approach. I notice in the 
>> Google Docs there is a way using PHP to upload via a POST direct from the 
>> client...
>> https://cloud.google.com/appengine/docs/php/googlestorage/user_upload...Is 
>> this just relevant to using PHP on app engine or is there an equivalent to 
>> createUploadUrl 
>> for python or javascript?
>>
>>
>> Anyway, I'll keep exploring but any pointers would be greatly appreciated.
>>
>>
>> Cheers
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/26350cef-7d03-4f43-9f1f-b1f08a42f579%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to