Attachments inside LAN

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

Hello, everyone!

We have made a file library with large files and would like to manage them through 1C, the question is how to attach files to catalog items without of loading them into infobase? We would like to display a hyperlink which will open that file in a certain program.

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Just use a catalog with "FilePath" attribute.

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

And what to do to fill it with file path and to open file?

 
#4
People who like this:1Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Here you can download sample application "Managed Application"
Download

As you can see, catalog "Goods" has PictureFile attribute. You could use it as an example

 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

Thanks, Leksus!

 
#6
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Sorry but it was bad example for you, because in this sample application files are stored in StoredFiles catalog, which has attribute FileData of ValueStorage type  :(
This is not good when you are dealing with large files.
Instead of storing files inside the database it's better to store them on a special storage. In this case you have to store only file path as I mentioned above

Edited: Leksus - Sep 12, 2012 02:21 PM
 
#7
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jul 18, 2012
Company: Bristol IT Solutions, LLC

Yep, I've got the idea. So I took path from FileDialog and put it in an attribute which is displayed on a form as a field of Label field type and checked Hyperlink checkbox. Then I added the Click event handler as follows:

Code
&AtClient
Procedure FileNameClick(Item, StandardProcessing)
   RunApp(Object.FileName);
   StandardProcessing = False;
EndProcedure

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.