Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Blob URL from expiring

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 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?

like image 361
Lumpy Avatar asked Jan 23 '26 03:01

Lumpy


1 Answers

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.

Using JQuery:

$.get("/blobUrl", function(data){
    $("#changeProfilePictureForm").attr('action', data);
    $("#changeProfilePictureForm").submit();
    $("#changeProfilePictureForm").hide();
    $("#loadingImg").show();
}); 
like image 161
Lumpy Avatar answered Jan 24 '26 21:01

Lumpy