FRMK
Posts: 38
|
Posted: 03/20/2014, 6:53 AM |
|
The FileUpload control appends a timestamp to the beginning of the filename.
Does anyone know how to retrieve the filename after a FileUpload?
Thank you.
_________________
FR |
|
|
cvboucher
Posts: 191
|
Posted: 03/20/2014, 9:31 AM |
|
The following code placed in the AfterProcessFile event of the FileUpload control will display the filename with the timestamp on the page.
MTFileUpload fu = (MTFileUpload)sender;
Response.Write(fu.Text);
Response.End();
Craig
|
|
|
FRMK
Posts: 38
|
Posted: 03/20/2014, 9:37 AM |
|
Thank you very much.
I thought I tried that, but I'll make sure. I appreciate you posting.
_________________
FR |
|
|
FRMK
Posts: 38
|
Posted: 03/20/2014, 2:52 PM |
|
Hmmm - AfterProcessFile and BeforeProcessFile are not executing, even though
the file does upload.
_________________
FR |
|
|
eratech
Posts: 513
|
Posted: 03/20/2014, 6:55 PM |
|
I think you can also use the Action 'Get Original Filename' but it only works in labels and links, although it should offer some code you could re-use elsewhere.
I've used it often, but in PHP projects, so I can't vouch for the .NET stuff.
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
cvboucher
Posts: 191
|
Posted: 03/21/2014, 9:34 AM |
|
Quote FRMK:
Hmmm - AfterProcessFile and BeforeProcessFile are not executing, even though
the file does upload.
I'm on the latest 5.1 so if you're not then maybe that is something that was fixed.
Craig
|
|
|
FRMK
Posts: 38
|
Posted: 03/21/2014, 10:06 AM |
|
I'm not on 5.1 yet - just 5.0. I'm afraid. :)
Do you think it's safe to step up to 5.1? Are you using it heavily without new problems for
.NET development?
_________________
FR |
|
|