You can achieve it by using custom attributes of input file button. It is not meant to store data but to allow the developer to assign some values to them to use it later in the code
since HTML is stateless.
Helping you always. Don't forget to click "Mark as Answer" on the post that helped you.
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
You can achieve it by using custom attributes of input file button. It is not meant to store data but to allow the developer to assign some values to them to use it later in the code
since HTML is stateless.
The answer that you marked as correct does not set the default file name of the input. All it does is tell you the name of the file that the user selected.
As I said right at the beginning, it is not possible to set a value for the file name in an input type-file.
The answer that you marked as correct does not set the default file name of the input. All it does is tell you the name of the file that the user selected.
As I said right at the beginning, it is not possible to set a value for the file name in an input type-file.
Member
90 Points
520 Posts
How can I set default file name of input file
Jul 19, 2019 06:56 AM|fatihbarut|LINK
hi all,
when user clicks the input file button I want to write 65847-68548654.pdf into its value to make it easy to chose right file among lots of others
as far as I know, it wasn't allowed before 2017 because of security reasons but now it is possible.
Could you tell me how can I do it?
thanks
All-Star
190372 Points
27640 Posts
Moderator
Re: How can I set default file name of input file
Jul 19, 2019 07:03 AM|Mikesdotnetting|LINK
Participant
1060 Points
732 Posts
Re: How can I set default file name of input file
Jul 20, 2019 12:02 PM|yogyogi|LINK
You can achieve it by using custom attributes of input file button. It is not meant to store data but to allow the developer to assign some values to them to use it later in the code since HTML is stateless.
I recommend you to read about them - https://www.w3schools.com/tags/att_global_data.asp
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
Member
90 Points
520 Posts
Re: How can I set default file name of input file
Jul 20, 2019 12:10 PM|fatihbarut|LINK
yeah there are lots of way to store data localy but I don't want to use them because of security reasons therefore I chose sessions at first
All-Star
53534 Points
13293 Posts
Re: How can I set default file name of input file
Jul 21, 2019 05:43 PM|bruce (sqlwork.com)|LINK
Member
10 Points
27 Posts
Re: How can I set default file name of input file
Aug 02, 2019 04:30 AM|ifour.parth@gmail.com|LINK
</script>
http://www.ifourtechnolab.com/blockchain-technology
Member
90 Points
520 Posts
Re: How can I set default file name of input file
Aug 02, 2019 06:51 AM|fatihbarut|LINK
it gave me good ideas but didn't tried it yet
All-Star
190372 Points
27640 Posts
Moderator
Re: How can I set default file name of input file
Aug 02, 2019 08:32 AM|Mikesdotnetting|LINK
The answer that you marked as correct does not set the default file name of the input. All it does is tell you the name of the file that the user selected.
As I said right at the beginning, it is not possible to set a value for the file name in an input type-file.
Member
90 Points
520 Posts
Re: How can I set default file name of input file
Aug 02, 2019 12:15 PM|fatihbarut|LINK
no problem, as I said it gave me good ideas