This BSV will demonstrate:
1) Exporting a document to the file system
2) Tracking the exported file name / path
3) Ability to delete a tracked file from the file system
4) Display the document using
....a) DISPLAY URL
....b) HTML link on Form
Download BSV here
Remove .bin extension after download
1) When you first run the BSV, click "System Settings for Docs". Default values for folders will appear as follows:
2) Upload Documents. Note that the target folder will be automatically created by AwareIM if it does not exist.
3) When you click "View Stored Docs", this Visual Perspective appears:
4) This Form is show how a stored document can be opened via HTML cell link.
Example BSV: Exporting files to the file system
Example BSV: Exporting files to the file system
Tom - V8.8 build 3137 - MySql / PostGres
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Thanks
Thanks for the sample Tom. One other question - how do you manage the size of the directory? I would think having thousands of documents in one folder could be an issue with retrieving.
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
UNC
Have you tried using a UNC path and hosting the files on a different server?
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
condition
What does the condition 1=0 mean?
If 1=0 Then
EXPORT DOCUMENT LoggedInRegularUser.Doc1 TO FILE SystemSettings.ExportPath_MyDocs+FILE_NAME(LoggedInRegularUser.Doc1)+'.'+FILE_EXTENSION(LoggedInRegularUser.Doc1)
If 1=0 Then
EXPORT DOCUMENT LoggedInRegularUser.Doc1 TO FILE SystemSettings.ExportPath_MyDocs+FILE_NAME(LoggedInRegularUser.Doc1)+'.'+FILE_EXTENSION(LoggedInRegularUser.Doc1)
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Another Question
Your example is very cool. I see some issues as it relates to my needs. There is going to be many times when the same file name will exist. We allow for Email messages and various other "documents" that all could have the same name. Using the SQL solution, I didn't have to worry about the same name being used.
I see that you check for existence of a file. This won't work for my application because the file that exists may not be related to the file were trying to place into the directory. I realize I could rename the files on export. If I go this route then I need a solution for renaming the file on display so that it accurately reflects the original document/filename. If I don't use the fileexists logic and just let it place the file into the directory, the file gets appended with a number. This works, but the problem is I don't know what the name of the file is. So, if there are three pitt.bmp files. The export would create pitt.bmp, pitt0.bmp and pitt1.bmp.
Any other ideas?
I see that you check for existence of a file. This won't work for my application because the file that exists may not be related to the file were trying to place into the directory. I realize I could rename the files on export. If I go this route then I need a solution for renaming the file on display so that it accurately reflects the original document/filename. If I don't use the fileexists logic and just let it place the file into the directory, the file gets appended with a number. This works, but the problem is I don't know what the name of the file is. So, if there are three pitt.bmp files. The export would create pitt.bmp, pitt0.bmp and pitt1.bmp.
Any other ideas?
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Sure
Yes, I could do that, but it just will open when I display the file with that information included. Not really what I want the user to see.
The way I am structured is this:
Order_Header (BO)
Contact (BO)
Contact_Activity (BO)
All 3 objects use Attachments for storing documents. I think if I use a directory structure like below it would give me enough uniqueness. So, this would basically say that you can't have the same filename at Parent BO Name/BO.ID level which I think kind of matches a traditional windows directory structure if I were organizing the above objects:
Parent BO Name/BO.ID/filename
Also, I tried using UNC path. It was a no go.
The way I am structured is this:
Order_Header (BO)
Contact (BO)
Contact_Activity (BO)
All 3 objects use Attachments for storing documents. I think if I use a directory structure like below it would give me enough uniqueness. So, this would basically say that you can't have the same filename at Parent BO Name/BO.ID level which I think kind of matches a traditional windows directory structure if I were organizing the above objects:
Parent BO Name/BO.ID/filename
Also, I tried using UNC path. It was a no go.
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Theory
Well it won't work by creating directories on the fly because AwareIM won't create directories more then 1 level deep. Yikes.
-
- Posts: 278
- Joined: Tue Aug 05, 2008 3:16 pm
Ok
Will do. For right now, we are going to load the attachments into SQL until the directory creation within AwareIm is more robust.
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact: