Reputation: 23276
The following snippet uploads the file to Blobstore :
<%!
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
%>
<form action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data">
<input type="file" name="myFile"/>
<input type="submit" value="submit"/>
</form>
After I have uploaded the file I get this type of URL :
http://xyz.appspot.com/_ah/upload/AMmfu6bzg8RIpHAQlpT-pLNnuEanbll7R6o5l8DRn-6ZRgCBw-ws-ddXiCnBV6r12zNGPmPJeSkeCoa7Jap-iKHBn-G13y_JVa4N7fj1pewu9GdjDgDSGQg/ALBNUaYAAAAAUBZtgd0ddRLqquuPP8d7GHWOS3BGudTi/
But I need to redirect to the upload page, after the upload has been done. Since I don't have access to the action form , how do I do this ?
Upvotes: 1
Views: 122
Reputation: 599876
That's exactly what createUploadUrl
does. You pass the URL that you want to be redirected to, and after the upload has completed, it redirects.
Upvotes: 1