c# - How to use a file from a client in ASP.net? -


i know server cant access hard drive or directories of client, why when hardcode directory application can access file , upload sql database?

just plain button

 <asp:linkbutton id="btnimportdata" runat="server" onclick="btnimportdata_click">import spreadsheet</asp:linkbutton> 

then code behind

  protected void btnimportdata_click(object sender, eventargs e)         {             dbconn.uploadtoexcel(@"c:\users\spadmin\desktop\abi employee list.xlsx");         } 

then can use file update database , works.

why cant use directories client?

update

link on how upload server using server.mappath

the code accesses file on server. regardless of pc use access web server looking on server's c drive.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -