Stop Blob URL from expiring

后端 未结 3 655
终归单人心
终归单人心 2021-01-15 16:26

I am uploading images to the blob store. I have copied the example from here.

The only problem I encounter is: If I load the page with the form, and not immedia

3条回答
  •  天命终不由人
    2021-01-15 16:53

    How long is it before the URL expires and how do you know it is an expiration causing your problem? I don't see the Google API docs mentioning this. Also, what Exception is thrown. Could you catch it server side and send the user back to the same page, with a newly generated upload URL. I know this does not fulfil your requirement for the user to not know this has happened.

    I guess one option is to find out how long until the URL expires and then use JavaScript to asynchronously call your server near the timeout, retrieve a new upload URL and change the URL in the DOM.

    However, the solution to catch the Exception and re-render sounds best, as I imagine the URL should only expire after the user has been idle for a fairly lengthy amount of time?

提交回复
热议问题