Click here to Skip to main content
11,414,561 members (65,740 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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 14-Dec-12 3:13am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,130
1 OriginalGriff 7,477
2 Maciej Los 3,710
3 Abhinav S 3,298
4 Peter Leow 3,084


Advertise | Privacy | Mobile
Web04 | 2.8.150427.4 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100