Guest Efthymios Kalyviotis Posted November 23, 2011 Posted November 23, 2011 Hello, I have created a file the following way. sFileName:= IntToStr(DevData.ID) + '_All_' + IntToStr(Year) + IntToStr(Month) + IntToStr(Day) + ' ' + IntToStr(Hour) + IntToStr(Min) + IntToStr(Sec) + '.CSV'; AssignFile(FType, UniServerModule.LocalCachePath + sFileName); Rewrite(FType); ... ... ... Then I display a link on that file: ShowMessage('CSV file has been created. You can download it from ' + '<a href="' + UniServerModule.LocalCacheURL + sFileName +'" target=new>here</a>'); When a user clicks the link, I have a new page that says: Access Denied for file 'blah blah blah...' I searched the forum and I found out that if I change the file extension to .txt, then it works ok. This seems to me like a security issue. Does anybody know how I can overcome this? Thank you very much Efthymios Kalyviotis. Quote
Administrators Farshad Mohajeri Posted November 23, 2011 Administrators Posted November 23, 2011 Workaround: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('csv', 'text/plain'); end; I will add this internally in next build. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.