Restricting file type on blobstore upload in Google App Engine (Java)
google-app-engine
Solution
There's no way to prohibit the user from uploading a prohibited filetype a-priori, because you can't tell what they're going to upload until they make the POST, and there's no clean way to terminate a POST request partway through. You can detect the filetype after they've uploaded the file, and delete the file from the blobstore if it's prohibited, however.
Problem
I'm using BlobstoreService for uploading a file to blobstore in AppEngine. How to restrict the content-type or file type of the file? For example, I only want to allow upload for image/jpeg files.