Commit db44d771 authored by Johannes Metscher's avatar Johannes Metscher

Improved file download

parent 9b0200a8
......@@ -229,22 +229,35 @@ If query <> "" Then
'Outlier if download is asked for
If InStr(host, "download") Then
Response.Buffer = False
'When query is available prepare for request sending
Dim file_url_only
file_url_only = False
'Split query
d = Split(query, vbCrLf)
'Set filetype to pdf
'Response.ContentType = "application/pdf"
'Response.Charset = "UTF-8"
'Response.AddHeader "Content-Transfer-Encoding", "binary"
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "Expires", "0"
'Iterate through variable d - data
'Read from data text input field and save it in newLicenseData to send it in request
For Each e In d
ps = Split(e, "=>")
If UBound(ps) = 1 Then
If Trim(ps(0)) <> "" and Trim(ps(0)) = "file_url_only" Then
If Trim(ps(1)) = 1 Then
file_url_only = True
Else
file_url_only = False
End If
End If
End If
Next
'Set filename of downloaded attachment
Response.AddHeader "Content-Disposition", "attachment; filename=Lizenz.pdf"
dim convertedBody
convertedBody = AlterCharset(body, "UTF-8" ,"ISO-8859-1")
Response.BinaryWrite convertedBody
Response.End
If file_url_only <> True Then
body = "This request cannot be handled by this Script. Please use the file_url_only parameter for licesnse download."
End If
End If
'If is no response yet, show some standard text
......@@ -291,5 +304,4 @@ label { display: block; }
<pre>CodePage: <% response.write Response.CodePage %></pre>
</body>
</html>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment