Click here to Skip to main content
15,885,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I am using a asp fileupload control.
I want to read the full file path from the control

But iam unable to read the value from the fileupload control.
I am geting a empty value.
Following is the control and code

<asp:FileUpload ID="FileNameControl" runat="server" />

this.PurchReqCatalogItemsDS.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call(WMDAddItemsFromExcelMethodName, FileNameControl.filename.ToString())

Actually i am using this for enterprise portal in Microsoft Dynamics Axapta 2012

i am getting a empty value from this
i have tried method FileNameControl.PostedFile.FileName.ToString();
But if i am using this iam getting "object reference not set to an instance" error

Can any one help me in this if iam missing anything

Thanks
Gangadhar
Posted

Hi Thanks for your solutions
I have kept the fileupload control inside a update panel and it worked

does anyone have any sample code to read a excel file which is taken from the file upload control ?

thanks in advance
 
Share this answer
 
 
Share this answer
 
Which side you want to get the full path? Server side or client side? In client side you cant get the full path. In server side you can try this code:

Server.MapPath(FileUpload1.FileName);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900