Code: Select all
srvroutine name(Download) response(#response)
field_map for(*INPUT) field(#RequestId) parameter_name(RequestId)
#COM_OWNER.CreateExcelFile( #wk_FilePath )
#SYS_APPLN.TraceMessageData( ('Excel File Created At &1').Substitute( #wk_FilePath ) )
#response.ContentFile := #wk_FilePath
#response.AttachmentFileName := 'PTORequest.xlsx'
endroutine
Code: Select all
evtroutine handling(#DownloadButton.Click)
define_com class(#PTORequestModule.Download) name(#download) target(New)
#download.Execute requestid(#RequestId)
endroutine
The problem is that the download is constantly returning a 404 error. I was following along with this post viewtopic.php?f=3&t=194&p=675 but I can't get the error to stop.
I am thinking it may be a permission issue, perhaps IIS (in this case) does not have permissions to the folder?
How can I get the server module to download the File?
EDIT
Tried setting the ContentType to 'application/vnd.ms-excel' thinking that perhaps IIS could not serve XLSX files, that did not work.
Tried writing to the *TEMP_DIR which for me is C:\Windows\Temp and that did not work either, although the File is clearly there.