停止Blob网址过期 [英] Stop Blob URL from expiring
本文介绍了停止Blob网址过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将图片上传到blob商店。我从
这里复制了示例
一>。
I am uploading images to the blob store. I have copied the example from here.
我遇到的唯一问题是:如果我用表单加载页面,
不能立即提交图像。 URL可以过期,当我做
尝试并加载图片时,我得到一个错误页面。如何检查URL $过期并
,并在用户不知道的情况下刷新URL?
The only problem I encounter is: If I load the page with the form, and not immediately submit the image. The URL can expire and when I do try and load the image I get an error page. How can I check to see if the URL has expired and refresh the URL without the user knowing?
推荐答案
当用户提交表单时,似乎解决方法是获取Blob URL。这样你就知道该URL不能过期。
It seems the work around is getting the Blob URL when the user submits the form. This way you know that the URL can't expire.
使用JQuery:
Using JQuery:
$.get("/blobUrl", function(data){
$("#changeProfilePictureForm").attr('action', data);
$("#changeProfilePictureForm").submit();
$("#changeProfilePictureForm").hide();
$("#loadingImg").show();
});
这篇关于停止Blob网址过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文