Hi Nick,

Thanks for answering! Your solution has one inconvenient for me: the 
downloading client needs also a bit of sophistication, not only the 
uploading client.

If I understood correctly, the downloading client will download one chunk 
after another. If this is the case, the browser would have to download all 
chunks, keep them in memory, assemble them into one blob, and then trigger 
the "download" from memory to the user file system. This is a problem if 
the file size is several GBs.

I know there are some browsers like Chrome that allow writing files to 
internal filesystem so that the assemble process can be done in disk. 
However, I need this process specially for those browsers that do not 
support FileSystem writing :)

The best solution I can think of is to have an instance machine with for 
example Apache+PHP that accepts an HTTP Get request for the download. The 
PHP would iterate over the chunks and output them to the client in the body 
of the only one HTTP Get request, and wait when the rest of chunks have not 
yet been uploaded. I think this will work, but it would not be cheap, as I 
would have to pay for the instance hours and for the bandwidth consumed to 
send chunks from GAE to the client.

What is your opinion?

On Thursday, April 21, 2016 at 11:53:24 PM UTC+2, Nick (Cloud Platform 
Support) wrote:
>
> Hey Hector,
>
> While this isn't possible in the way you described exactly, since you can 
> only begin fetching an object once it's been uploaded successfully, there 
> is a solution which accomplishes essentially the same thing, although it 
> will require a slight bit of sophistication in the uploading client to 
> ensure things go well:
>
> Have the uploading client send chunks of the file to the Cloud Storage API 
> as a multipart upload 
> <https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#multipart> 
> while, 
> at the same time, sending these chunks to the other client (or sends them 
> to a location where it will be available to the other client upon request).
>
> The complexity arises when you need to perform 2 multi-part upload 
> processes, with retry / back-off logic for the two streams being 
> independent. 
>
> I hope this is clear enough in my explanation, let me know if you have any 
> questions.
>
> Cheers,
>
> Nick
> Cloud Platform Community Support
>
> On Tuesday, April 19, 2016 at 1:11:41 PM UTC-4, Hector Montaner wrote:
>>
>> What I want to achieve is one client uploads a file to Google Cloud 
>> Storage (several GB) and another client starts to download it before the 
>> upload is finished, in a pipelined way.
>> Is it possible? If not, what alternatives do I have?
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/2bb31c2d-fe35-4a17-b4d8-c8d8389e0345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to