1 fileName getTempfileName(QVS_VendAttachment _QVS_VendAttachment)
2 {
3 BinData binData;
4 Filename filename;
5 FilePath filePath;
6 #WINAPI
7 str endSlash(str _str)
8 {
9 return (strscan(_str, '\\',strlen(_str),-1)) ? _str : _str + '\\';
10 }
11 ;
12
13 binData = new BinData();
14 binData.setData(_QVS_VendAttachment.VendAttachment);
15
16 filePath = endSlash(true ? WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE) : xInfo::directory(DirectoryType::Temp));
17
18 filename = _QVS_VendAttachment.Filename(filePath);
19
20 binData.saveFile(filename);
21
22 // IF(WINAPI::fileExists(filename))
23 // winAPI::shellExecute(filename);
24 return filename;
25 }