Hello,
I followed this article for uploading and downloading files from database http://www.c-sharpcorner.com/UploadFile/0c1bb2/uploading-and-downloading-pdf-files-from-database-using-asp/ .
The difference is that I use Windows forms instead of Web forms and I need to have the file selected in a listView uploaded. Whenever I run the code I get FileUpload1.HasFileFileUpload1.HasFile=false.
Note that I can't find where to add the following line of code in my application.
<asp:FileUpload ID="FileUpload1" runat="server" ToolTip="Select Only Excel File" /><asp:FileUpload ID="FileUpload1" runat="server" ToolTip="Select Only Excel File" />
Any suggestions?
Thank you in advance.
Posted Oct 3, 2013, 1:05 AM
You can't use
To upload / select a file, you need to use FileOpenDialog control in windows forms application.
You can apply filter to this control, to show only *.pdf files also.
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter ="PDF files (*.pdf)|*.pdf|All files (*.*)|*.*";
For more information,
http://www.c-sharpcorner.com/UploadFile/RPattinson/openfiledialog-in-C-Sharp/
http://msdn.microsoft.com/en-us/library/aa984392(v=vs.71).aspx
Please let me know, if you need more help.
DealyPosted Oct 3, 2013, 4:19 AM