Help to Upload zip file containing CSV file in GAE
I am a student who needs help in uploading a zip file that contains CSV file into the GAE Server using java.
I am currently using u开发者_运维百科ploadBean to upload my zip file in my server (Tomcat,localhost). Here is the code:
UploadBean upBean = new UploadBean();
upBean.setWhitelist("*.zip");
upBean.setOverwrite(true);
String path = getServletContext().getRealPath("/WEB-INF/downloads");
upBean.setFolderstore(path);
upBean.store(mrequest, "bootstrap_file");
I want to upload the file in GAE as i am migrating my codes to GAE standards. I have seen many online recommendation is to use blob. I was reading the Google site for hours but i am not even able to understand how to operate the code in a way that i can save the zip file. All i want is to upload the zip file in the /WEB-INF/downloads and than get the files to be unzipped for my logic to run.
Hope i can get help from you.
Advance thanks!
AppEngine static files: http://code.google.com/appengine/kb/java.html#readfile
Handling zip files in java: http://www.exampledepot.com/egs/java.util.zip/pkg.html
Read this example to see how to read and unzip a file on AppEngine: http://github.com/gvaish/gae-utils/blob/master/src/main/src/com/mastergaurav/gae/server/UnzipperServlet.java
精彩评论