OpenNTF.org - fileSendr
fileSendrOpenDocument[/projects/pmt.nsf/ProjectView?ReadForm&Query=]

My Links (Not logged in)
User Name Password
Hosted by Prominic.NET

   Project: fileSendr (Managed by Declan Lynch)
Actions:

Hide details for The bugThe bug
Bug ID: NOSS-97YTE7
Description
Submitted by:Janko Stefancic
Project Master Chef:Declan Lynch
Bug type:
Brief Description:Anonymous user can't upload files with authorization code + SOLUTION
Severity:
Versionv1.2.0.1
Status:Submitted

Details

I create and send an authorization code to a user, which accesss fileSendr with Anonymous access.
When he tries to upload the files this error is thrown:

Exception occurred calling method NotesDocument.save(boolean) null

 

Solution (FIX):

1) Custom control: cc_fileUploader
a) Computed field: cf_EmbedUploadedFilesToDoc = change the code to use sessionAsSigner to access and save document

2) Custom control: browser_uploadFiles
a) Button: button1 (Upload and save files) = same thing change the code to use sessionAsSigner

 

Example: browser_uploadFiles

// Get the current document and it's changes
var dbC:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath());
var thisDoc:NotesDocument = dbC.getDocumentByUNID( authDoc.getDocument(true).getUniversalID() ); 
 
// Set the authorization key to used
thisDoc.replaceItemValue("$PublicAccess","1");
thisDoc.replaceItemValue("IsUsed","true");
thisDoc.replaceItemValue("file_Storage","local")
thisDoc.save();

 

I can send you both custom controls with the fixed code if you want.

 

 

// Get the current document and it's changes
var dbC:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath());
var thisDoc:NotesDocument = dbC.getDocumentByUNID( authDoc.getDocument(true).getUniversalID() ); 
 
// Set the authorization key to used
thisDoc.replaceItemValue("$PublicAccess","1");
thisDoc.replaceItemValue("IsUsed","true");
thisDoc.replaceItemValue("file_Storage","local")
thisDoc.save();

 

 

// Get the current document and it's changes
var dbC:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath());
var thisDoc:NotesDocument = dbC.getDocumentByUNID( authDoc.getDocument(true).getUniversalID() ); 
 
// Set the authorization key to used
thisDoc.replaceItemValue("$PublicAccess","1");
thisDoc.replaceItemValue("IsUsed","true");
thisDoc.replaceItemValue("file_Storage","local")
thisDoc.save();
// Get the current document and it's changes
var dbC:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath());
var thisDoc:NotesDocument = dbC.getDocumentByUNID( authDoc.getDocument(true).getUniversalID() ); 
 
// Set the authorization key to used
thisDoc.replaceItemValue("$PublicAccess","1");
thisDoc.replaceItemValue("IsUsed","true");
thisDoc.replaceItemValue("file_Storage","local")
thisDoc.save();


Action taken
Status:Submitted
Implemented in Release:
Fix Details:
Modification history
Entered 20-Jul-2011 16:27 by Janko Stefancic. Last Modified <none> by <none>.