Last post Jul 15, 2007 05:07 PM by Kaan
Jul 15, 2007 01:44 PM|Kaan|LINK
I'd like to automatically open the browse window when a button pressed. How is it possible?
Jul 15, 2007 02:38 PM|Haissam|LINK
Try to add the below code at page_load event
Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()");
Where button1 is the id of the button you want to open the browser window when being clicked
and FileUpload1 is the id of the file upload control
Jul 15, 2007 03:04 PM|Kaan|LINK
Thanks for the reply Haissam;
It works and opens the browse window, However; it doesn't select the file? Any further suggestions?
Jul 15, 2007 03:09 PM|Haissam|LINK
Can u clear the idea about "it doesnt select the file". i just didnt get it.
Jul 15, 2007 03:18 PM|Kaan|LINK
Normally in a fileupload when you click browse and select a file, it pastes the path; but when I open browse window with the code it doesn't paste the path...
Actually let me be more clear, I'm trying to make a fileupload like gmail or yahoo. I want that when the client presses one button s/he can select the file and when the file is selected control will upload automatically...
Jul 15, 2007 03:40 PM|Haissam|LINK
the return false will cancel the postback after button is clicked now on page_load event add the below code
Jul 15, 2007 03:54 PM|Kaan|LINK
Now could you please tell me which event should I handle the uploadfile thing..
I mean Now I can select the file, but how can I trigger the upload?
Thanks a lot..
Jul 15, 2007 04:04 PM|Kaan|LINK
Jul 15, 2007 04:52 PM|Haissam|LINK
try to do something similar
Jul 15, 2007 05:07 PM|Kaan|LINK
Therefore my question would be how can I programmatically upload a file given the path? :)
What I'm currently doing is I upload the files to a temp folder on the server, then when a user presses send button I attach em to the e-mail... The advantage is user can write the body during the file upload... Actually gmail and yahoo does quite the kinda
same I guess, Because I can see the file uploading before I press the send button..
Thank you very much for your adds; However I should find out how can I automatically start file upload or programmatically upload the file...