Notes on multipart implementation

satya - 4/12/2014 2:33:04 PM

Intro

This page high level notes on multipart post implementation in aspire.

satya - 4/12/2014 2:34:27 PM

Usually you access the upload page through


/akc/display?url=uploadMPURL&reportId=4788&ownerUserId=some-user-id

satya - 4/12/2014 2:35:13 PM

Go to that page and view source to see what update request is called

Go to that page and view source to see what update request is called

satya - 4/12/2014 2:36:15 PM

It looks something like this


   var vAction = "/akc/update/DocFUL";
   var filename=document.FileUploadForm.datafile.value;
   if (filename.length == 0)
   {
      alert("Sorry. You need to choose a filename to upload");
      return;
   }
   document.FileUploadForm.action=vAction;
   document.FileUploadForm.submit();

satya - 4/12/2014 2:36:28 PM

So look for the server side pipeline for DocFUL

So look for the server side pipeline for DocFUL

satya - 4/12/2014 2:36:47 PM

it is kept in the module: /reports/upload/upload.properties

it is kept in the module: /reports/upload/upload.properties

satya - 4/12/2014 2:37:23 PM

Here is how the general flow works


request.DocFUL.classname=com.ai.db.DBPreTranslateArgsMultiRequestExecutor
request.DocFUL.db=reportsDB
request.DocFUL.request.1=DFUL.parsemultipart
request.DocFUL.request.2=DFUL.validateExistingFile
request.DocFUL.request.3=DFUL.FULCopyFile
request.DocFUL.request=DFUL.savefileInDatabase

satya - 4/12/2014 2:38:45 PM

Key part: com.ai.parts.SingleFileUPloadCommonsPart

Key part: com.ai.parts.SingleFileUPloadCommonsPart

satya - 4/12/2014 2:41:10 PM

Here is the previous implementation note on this subject

Here is the previous implementation note on this subject

satya - 4/12/2014 2:42:59 PM

Here is another item

Here is another item

satya - 4/12/2014 2:58:54 PM

I also use the class: com.ai.parts.FULCopyFilePart

I also use the class: com.ai.parts.FULCopyFilePart

satya - 4/12/2014 3:02:41 PM

Source code of : FULCopyFilePart

Source code of : FULCopyFilePart

satya - 4/12/2014 3:04:29 PM

You can search here for source code of Aspire parts

You can search here for source code of Aspire parts

satya - 4/12/2014 3:17:25 PM

Apache Commons File Upload home page

Apache Commons File Upload home page

satya - 4/12/2014 3:23:10 PM

API docs for commons file upload

API docs for commons file upload

satya - 4/13/2014 11:13:19 AM

I use the FileUtils.getSystemtempdirectory


public static String getSystemTempDirectory()   
{
    return System.getProperty("java.io.tmpdir");
}

satya - 4/13/2014 11:27:14 AM

See the limitation of FileItem as it deletes the temp file on it going out of scope...

See the limitation of FileItem