AJAX :: ASyncFileUpload UploadedComplete Event - Saving The PostedFile.filename Value?
Feb 14, 2011
I have the asyncFileUpload control inside a user control which is a wizard control step. The wizard control is inside a AJAX update panel.
I have a requirement to save the complete folder path along with the file name when user selects a file in the asyncFileUpload control. In order to achieve this on the server side UploadedComplete even I save the PostedFile.FileName to a session variable.
Then on the client side OnClientUploadComplete I force a postback for the UpdatePanel. In the postback I get session variable value and then do my processing.
server side upload completed event when I save the posted file name to a session variable. This is working in my local machine. I am able to retrieve the Session variable on the postback, but when I move the code to my test server the Session value is coming out as blank. I validated that the UploadedComplete event is triggered on the server, but for some reason the Session value is blank.way I can get the PostedFile name (complete path) on the Client side?
The AsyncFileUpload control turns green, indicating that the attachment was successfully uploaded, but the designated method for handling the server side UploadedComplete event is never executed.
I recently came across the AsyncFileUpload control in the latest (3.0.40412) release of the ASP.Net Ajax Control Toolkit. There appears to be an issue when using it in a hidden control that is later revealed, such as a <div> tag with visible=false.
I'm new to ASP.NET AJAX AsyncFileUpload so I've created an aspx page to test it but it seems there's some bug with that control because the server side UploadedComplete event does not fire.
I have my asyncfileupload set up to give the posted file a new guid as its filename, what i need is the NEW filename so i can insert it into a database. PostedFile just gives me the original name, as does args.get_fileName().
I'm saving a file with the asyncfileupload ajax plugin from the ajax toolkit and when I save it I'm changing the filename (to avoid multiple files with the same name).
After the file is uploaded, the user needs to know what the file has been named so I'm using this javascript code on the onclientuploadcomplete event.
function UploadComplete(sender, args) { alert(args.get_fileName()); }
This works except it gets the old name, not the new name (which is determined server-side). Is there any way to get it to return the new name rather than the old name? Or any work around to achieve this?
This is my code in the code behind the get the new filename:
in my code when i look at txtLocalResource.PostedFile.FileName it returns only the filename, the rest of the path is missing? i am using ie8 and vs2010.
Anyone know why RegisterStartupScript won't work in the UploadedComplete event? It used to work just fine, but in version 40412, it doesn't do anything.
I had started another thread called 'AsyncFileUpload Broken??!!??', before I realised what was causing the problem. Now that I have found the culprit, I thought a new thread is needed on this issue alone.
And I'd like to update it to the value of FileUpload1.PostedFile.FileName I have this in a variable in the aspx.vb page as myFileName How would I use that value in the UpdateParameters section?
On my webform I have an AsyncFileUpload control. At first it is set not to be visible until two textboxes are filled. On the textbox_textchanged events the uploadcontrol is made visible. At that time the UploadedFileError event is fired.... why? The control is empty, so there is nothing to upload, but apparently it still tries to.How can I fix this?
I cannot get the asyncfileupload to fire the uploadcomplete event at all.
I did a test:Protected Sub AsyncFileUpload1_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AsyncFileUpload1.UploadedComplete
How to know the FileName AjaxFileUpload in the event Click of a Button without going through earnest for this is what I found that is to say that the FileName is only in the event Designed AjaxFileUpload1_UploadComplete.
The UserProfileForm1 control is a form builder that creates a form based on the profile design. When the form is posted, I am looking through the controls in the form and handling each one as needed. We there is a file upload control it shows up as a htmlinputfile control but the postedfile property is always nothing.When I look at the Request.Files collection the first file (Request.Files(0)) is the file I selected to upload. Why is this not being mapped back to the control under .postedfile?I have a control builder which uses the following code to create the control
Dim file As New HtmlInputFile file.ID = "fil" & md.DataID & md.Name Return file
am using the AsyncFileUpload, when the AsyncFileUploadEventArgs event is fired i need to check if a textbox as been populated which i am doing. the problem is i am setting the validator to invalid. i would of thought this would display the error to the user, but nothing happens
i am using AsyncFileUpload in a upadte panel but while i am running this project it shows a server error that could not found AsyncFileUpload1_UploadedComplete event in Updatepanel1
I am just about to learn how the AsyncFileUpload component works. I have come up with some code but this does not compile excactly. It seems but are not sure that I need to declare some events etc... I will explain excactly what my goal is to do. It will be possible to upload a .jpg file from a users computer and save this file to the below path with a new name: