Click here to Skip to main content
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 2: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 CPallini 420
1 Sergey Alexandrovich Kryukov 310
2 George Jonsson 269
3 Gihan Liyanage 255
4 OriginalGriff 245
0 OriginalGriff 4,903
1 CPallini 3,960
2 Sergey Alexandrovich Kryukov 3,474
3 George Jonsson 2,786
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
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