Ana içeriğe geç

Attachmenta Eklenen Dosyalırı Toplu Kaydetmek

Projeye sag tıklayarak referans dosyalarına yazalım

%SystemPath%\Common\eBAPI.dll
%SystemPath%\Common\eBAZipLibrary.dll



//Formun yukarısındaki usinglere ekleyelim

using eBAPI;
using eBAPI.Connection;
using eBAPI.DocumentManagement;
using eBAZipLibrary;
using System.IO;
        void zipResponse(string category)
{
using(eBAConnection con = CreateServerConnection())
{
con.Open();
using (Stream zip = new MemoryStream())
{
ZipFile zipfile = new ZipFile();
DMFile flWfd = con.FileSystem.GetWorkflowFile(id);
//foreach (DMFileRelation rel in flWfd.GetRelations())
foreach(DMFileContent dmc in flWfd.GetAttachments(category))
{
string name = dmc.ContentName;
zipfile.AddEntry(name, flWfd.DownloadAttachmentContentBytes(category,name));
}
zipfile.Save(zip);
eBAForm f = new eBAForm(id);
WriteToResponse(zip, id.ToString() + " ID li Form Ekleri.zip");
}
}
}


public void Button1_OnClick(Object sender, EventArgs e)
{

string kategori = "category1"; // veya TextBox1.Text // Attachment nesnesindeki kategori bilgisin alıyoruz
zipResponse(kategori);


}