Multiple document upload via Zipfile
Status: Ready for Test
Developer: Deepak
Work: 4w?
User Stories
The user wishes to upload a collection of files and folders from their workstation to the document vault of a project.net workspace. The user uses a zip tool on their workstation to zip up a collection of folders and files creating a single zipfile ending with the .zip file extension. They navigate to the project.net document folder where they want the files to be uploaded to. They click the "Import Document" toolbar icon. The user selects the zipfile as the "File to Upload" and indicates they want the zipfile to unziped creating multiple documents. They may also choose to upload the zipfile as a single file. If they choose to have project.net expand the zipfile, the application should expand the folder and file hierarchy creating all the subfolders and files below the current project.net folder. Each folder name and file name in project.net should be set to the name in the zipfile. If the user selects to have a zipfile expanded, the "Name" field on the Document Import page should be inactivated (using javascript/DHTML) and ignored (in the project.net upload processing).
Not in scope: GUI, applet, drag-and-drop
Multiple Document upload
The goal of multiple document upload feature is to give Project.NET customers the capability to upload multiple documents from a zip file. The new process will utilize the java.util.zip.ZipFile? package to extract the user uploaded zip file into the Project.NET document vault directory. The new feature will shorten the overall timeframes for uploading only single document at a time. The new feature will allow the customers to upload the entire directory structure into the Project.NET document vault folder.
The core of the new feature will be to upload collection of files and folders from a zip file to the Document Vault of the Project.NET workspace. The Document Vault screen of Project.Net will provide an option to expand the zip file into the Project.NET document vault folder. So the Project.NET application should expand the folder and file hierarchy by creating all the subfolders and files below the current Project.NET document vault folder. The Project.NET will store the information of the files being uploaded in the documents vault folder into the database.
Assumptions
The user has to zip the collection of files and folders into a zip file.
Current Process
- Accept a File from the document upload screen.
- If the file is empty then throw a missing request parameter file exception.
- If the file is not empty then copy the file into some temporary location.
- If the File contents are empty then throw an invalid document exception.
- If not then get the fully qualified clients path of this document.
- Get the MIME type.
- Get the document ID for this object.
- Determine the location the document vault into which the file will be added.
- Check to ensure that all the path components have been specified successfully.
- Determine the root storage path in the document vault.
- Create those directories in the document vault.
- Get the File handler ID of the file being uploaded.
- Move the file from the temporary location to the document vault folder.
- Store the information of the uploaded file in the document vault folder in the database.
New Flow
- Accept a File from the document upload screen.
- New check box to determine if the expand zip file option is selected to upload multiple files and folders.
- If the file is empty then throw a missing request parameter file exception.
- If the file is not empty then copy the file into some temporary location.
- If the File contents are empty then throw an invalid document exception.
- If not then get the fully qualified clients path of this document.
- Get the MIME type.
- Get the document ID for this object.
- Determine the location the document vault into which the file will be added.
- Check to ensure that all the path components have been specified successfully.
- Determine the root storage path in the document vault.
- Create those directories in the document vault.
- Get the File handler ID of the file being uploaded.
- If expand zip file option selected then extract all the files and folders from the temporary location into the document vault folder.
- If not then move the file from the temporary location to the document vault folder.
- Store the information of the uploaded file in the document vault folder in the database.
Reviewer's Comments
- If the file is not a zip file or there are error unzipping that file, an error should be presented to the user. (i.e. “The uploaded file is not a zipfile”).
- You may not need to expand the zipfile to a temporary location. Does the java.util.zip.ZipFile? class allow you recursively read and get file handles directly from the zipfile?
