ep file downlading problem

hello everyone ;

i have a problem about file downloading in EP 4.0 . the goal is user can upload file to a specific folder in sharepoint ,

and whenever you want you could download it … the file format is free . pdf. xls .txt. doc etc…

i am holding folder properties in a table . the code block is below:

_fileName = file;
filesize = WinAPI::fileSize(_fileName);

// response.clear();
response.addHeader(“Content-Disposition”,“attachment; filename=” + _fileName);

binData = new BinData();

  • file means Pyschical Path

What is wrong with this code , when i try to link button which is Download … save dialog is opened but downloading is not successfully complete. especially txt file was very weird behaviour that was included some HTML content…

any idea ?

Thanks in advance…

Best Regards