I would like to find out how to parse a xml file that has been uploaded to 
the blobstore. Below is the code that I have.

Can any one recommend a solution to this? At the moment my project uploads 
the xml file and serves it through a serve.java file

(file Upload.java):

package uploaddata;
import java.io.IOException;import java.util.Map;
import javax.servlet.ServletException;import 
javax.servlet.http.HttpServlet;import 
javax.servlet.http.HttpServletRequest;import 
javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.blobstore.BlobKey;import 
com.google.appengine.api.blobstore.BlobstoreInputStream;import 
com.google.appengine.api.blobstore.BlobstoreService;import 
com.google.appengine.api.blobstore.BlobstoreServiceFactory;import 
com.google.appengine.api.files.AppEngineFile;
public class Upload extends HttpServlet {

    private static final long serialVersionUID = 1L;
    private BlobstoreService blobstoreService = 
BlobstoreServiceFactory.getBlobstoreService();

    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {

        @SuppressWarnings("deprecation")
        Map<String, BlobKey> blobs = blobstoreService.getUploadedBlobs(req);
        BlobKey blobKey = blobs.get("myFile");

        if (blobKey == null) {
            res.sendRedirect("/");
        } else {
            System.out.println("Uploaded a file with blobKey: 
"+blobKey.getKeyString());
            //BlobstoreInputStream is = new BlobstoreInputStream(new 
BlobKey("blobKey"));
            res.sendRedirect("/serve?blob-key=" + blobKey.getKeyString());
        }

}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to