Click download file by "Download widget", but no file extension

Click download file by "Download widget", but no file extension

  

Hi I want to use upload and download widget, I want to download this file after uploaded file in database. 

I use "Link" link to a server action, the server action flow is "Start -> GetFileById ->Download" , but there is no file extension when download the file. 

e.g 

Upload file: photo.jpg

Download file: photo


Please help, thanks

Solution

Hi Test Ac (you should really give yourself a more sensible name ;)),

When you upload a file, the Upload Widget's Filename property contains the name of the file, including the file extension:

If you save that name in the database, and you use that as the File Name Property of the Download Statement, your file should have the same name as the one you uploaded.

So I'm wondering, have you debugged your app at all? Checked what goes in the database, checked the result of the GetFilePdfById query, etc.? If so, what did you see at those stages?

Solution

Kilian Hekhuis wrote:

Hi Test Ac (you should really give yourself a more sensible name ;)),

When you upload a file, the Upload Widget's Filename property contains the name of the file, including the file extension:

If you save that name in the database, and you use that as the File Name Property of the Download Statement, your file should have the same name as the one you uploaded.

So I'm wondering, have you debugged your app at all? Checked what goes in the database, checked the result of the GetFilePdfById query, etc.? If so, what did you see at those stages?

Thank you for your reply, I found the problem now. It is because I should not use the File Name "input" to save in DB, it should save by "upload1.Filename" instead. I enter the file name like "photo" , "test_photo" or  "photo001" without extension under the File name input. Thus, the file name save without extension. Now I made a change, save by "Upload1.Filename". The file can be download properly. 

Thanks


Hi Test Ac,

Good to know you've solved it! Debugging can be a life-saver, and should always be your first choice of troubleshooting.