Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
amitapatil

Member
Registered:
Posts: 14
Reply with quote  #1 

Hi Friends

I am using Metastorm 7.0.Being a new in Metastorm world need your help for Attachment clip control.

On button click want to upload the excel file and save it on disk.Once file is saved want to store data into database(SQL Server).

I am using multiple attachemnt control.

I could upload the file but while saving its giving error

"An empty value was specified for a file name. Procedure GetAttachment call failed"

Sytax for getattachment: %GetAttachment(%FolderID,%Test_Clip,"E:/Amita_Attachment")

Can anyone help me out for this.Thanks.

0
rbrodka

Senior Member
Registered:
Posts: 76
Reply with quote  #2 
Hello Friend,

When you select a file using the file clip control, the file is stored in the eAttachment table of the Metastorm database.  For a single attachment control, the clip variable contains the name of the file, but for multi-attachment clip controls, this is not the case.

The code below is JScript server side code I use to save multiple attachments to the file system.  I get the file names by selecting from the eAttachment table.

I believe the attachments go through a conversion of some sort (unicode perhaps) before being stored in the database.  I don't recall the details off the top of my head, but if you search the forum you will find lots of information.

Hope this helps.

Randall

//___ Store the attachments in the file system ______________________________________

function copyAttachmentsToFileSystem() {
var FolderID = ework.FolderID;
var FolderName = ework.FolderName;
var FileName = '';

var AttachmentPath = '';
AttachmentPath = AttachmentPath.concat("C:\\BPM_Data\\ECR\\", FolderName);

var SQL = '';
SQL = SQL.concat("SELECT eKey ");
SQL = SQL.concat("FROM eAttachment ");
SQL = SQL.concat("WHERE eKey like '%", ework.FolderID, "%' ");
SQL = SQL.concat("AND left(eKey,1) = 0");
var response = ework.SelectSQL(SQL);
if (response != '') {
var rows = response.split('\r\n');
for (var i = 0; i < rows.length; i++) {
FileName = rows[i].substr(34);
ework.GetAttachment(FolderID,FileName,AttachmentPath);
}
}
}
0
amitapatil

Member
Registered:
Posts: 14
Reply with quote  #3 

Hey thanks..Its worked for me :)

0
Kal

New Member
Registered:
Posts: 3
Reply with quote  #4 
does this jscript work in V7.6 i have tried to use it but does not seem to work, are you able to help?


0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!