You are viewing limited content. For full access, please sign in.

Question

Question

save website download to repository

asked on August 25, 2016

Need to save a report file (typically a PDF) generated on a website directly into a specific folder in the repository. Is this possible?

Thanks

0 0

Replies

replied on August 25, 2016

Is it going to be the same folder each time or does it change dynamically?  The short answer is yes but I can attempt to help with more details.

0 0
replied on August 25, 2016

Thanks Jonathan! I posted a similar question except going in the upload direction 10 days ago and have not gotten any replies, so I wasn't optimistic

Our ideal solution would be dynamic; select a specific location in the repository for each download.

0 0
replied on August 25, 2016

will all the destination subfolders have the same root folder or will this be like a whole new filing tree?

 

0 0
replied on August 25, 2016

likely best that I try to convey folder structure:

"client type"  (wholesale or retail)

     "client"     (john doe, harry james, yosemite sam, ...)

              "annual work"

                        "year"    (2013, 2014, 2015, ...)

                                   "data received"  (where we would save the download)

0 0
replied on August 25, 2016

ok.... so a few things about importing docs into LF  First you have to create the placeholder.  Kind of like a "shell" that the document will occupy, then you have to place the file in the "shell"

so the steps:

1. Establish the connection

LFApplication lfApp = new LFApplication();

LFServer lfServ = (LFServer)lfApp.GetServerByName("LF Server Name");

lfRepository = (LFDatabase)lfServ.GetDatabaseByName(Repository);

lfCon = new LFConnection();

lfCon.UserName = username;

lfCon.Password = password;

lfCon.Create(lfRepository);

 

2. instantiate your objects

LFDocument newDoc = new LFDocument();

LFVolume lfVol = (LFVolume)lfRepository.GetVolumeByName(Volumne name)

LFFolder folder = (LFFolder)lfRepository.GetEntryByGUID(folderGUIID);  there are a few methods to get the folder.  this is the one I use in my app because the folders are generated dynamically and it is just easier for me. You can also GetEntryByPath and don't remember any others off hand

3. Create the "shell" I mentioned before (the third parameter in newDoc.Create is for auto rename incase the doc already exists with same name in the folder)

newDoc.Create(document name as it will be in LF, LF Folder from step 2, LF Volume from Step 2, false); // Create place holder for the Document. No actual information is stored in the document

LFAccessRights rights = (LFAccessRights)newDoc.Rights;

rights.InheritsRights = true;  //New Document inherits the access rights from the parent folder

newDoc.Dispose(); //Clean up

4.  This part actually inserts your PDF into the shell created above

DocumentImporter docImporter = new DocumentImporter(); //This actually imports the data into the placeholder created for the document

LFDocument doc = (LFDocument)lfRepository.GetEntryByNameAndParent(document name as it will be in LF, LF Folder from step 2);

docImporter.Document = doc;

docImporter.ImportElectronicFile(This is the FULL PATH to the document);

 

doc.Dispose(); //Clean up

 

 

 

0 0
replied on August 27, 2016

Jonathan - I won't have a chance to really look at this till Tuesday. Thanks for the info tho, anxious to review

0 0
replied on August 25, 2016

Hey Bill did that solve what you are trying to do?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.