Click here to Skip to main content
15,890,690 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Text box Format problem Pin
Baran M21-Jul-09 18:17
Baran M21-Jul-09 18:17 
QuestionOpen file in their respective application Pin
Shivan Nandan19-Jul-09 19:55
Shivan Nandan19-Jul-09 19:55 
AnswerRe: Open file in their respective application Pin
Abhijit Jana19-Jul-09 19:58
professionalAbhijit Jana19-Jul-09 19:58 
GeneralRe: Open file in their respective application Pin
Shivan Nandan19-Jul-09 20:09
Shivan Nandan19-Jul-09 20:09 
GeneralRe: Open file in their respective application Pin
N a v a n e e t h19-Jul-09 20:20
N a v a n e e t h19-Jul-09 20:20 
QuestionProbelm in ajax password strength control Pin
janani1319-Jul-09 19:38
janani1319-Jul-09 19:38 
AnswerRe: Probelm in ajax password strength control Pin
Baran M20-Jul-09 0:17
Baran M20-Jul-09 0:17 
QuestionFileUploading gives error on Production Server Pin
meeram39519-Jul-09 19:03
meeram39519-Jul-09 19:03 
I have a fileupload control in my form for uploading PDF files. The issue is it is working fine in my local host and failing in production server. It is giving error that "Error Uploading File. The path is not of a legal form".

Following is my code:
protected void DocumentUploadButton_Click(object sender, EventArgs e)
    {        
       
        string errMsg = string.Empty;
        string PDFFilename = string.Empty;
        string PDFSaveLocation = string.Empty;

        if (DocumentFileUpload.HasFile)
        {
            string DocFileName = Path.GetFileName(DocumentFileUpload.PostedFile.FileName);
            string FileExtension = Path.GetExtension(DocumentFileUpload.PostedFile.FileName);

            string appPath = System.Web.HttpContext.Current.Request.ApplicationPath;
           

            if (!appPath.EndsWith("/", StringComparison.Ordinal))
            {
                appPath = String.Concat(appPath, "/");               
                PDFFilename = Path.GetFileName(DocumentFileUpload.PostedFile.FileName);
                ViewState["PDFFilename"] = PDFFilename;
                PDFSaveLocation = Server.MapPath(String.Concat(appPath, "/tmp/")) + PDFFilename;
                Label3.Text = "PDFFileName: " + PDFFilename;
                Label1.Text = "PDFLocation: " + PDFSaveLocation;
                DocumentFileUpload.PostedFile.SaveAs(PDFSaveLocation);
            }
            try
            {
                Guid g = AddFile(DocumentFileUpload.FileBytes, PDFFilename);
                ViewState["DocumentFileId"] = g;              
                File.Delete(PDFSaveLocation);

                DocumentUploadedCustomValidator.IsValid = true;
          
            }
            catch (Exception ex)
            {
                string strmsg = ex.Message;
                Label4.CssClass = "ErrorMessagesLabel";
                Label4.Text = "Error Uploading File. " + strmsg;
            }
}


Any idea what is the issue? Please help.I am not getting any head and tail of the issue since it is working fine in local system. It is not even printing the path and pdf file name.

Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

AnswerRe: FileUploading gives error on Production Server Pin
Brij19-Jul-09 19:26
mentorBrij19-Jul-09 19:26 
GeneralRe: FileUploading gives error on Production Server Pin
meeram39519-Jul-09 19:37
meeram39519-Jul-09 19:37 
AnswerRe: FileUploading gives error on Production Server Pin
Abhijit Jana19-Jul-09 19:30
professionalAbhijit Jana19-Jul-09 19:30 
GeneralRe: FileUploading gives error on Production Server Pin
meeram39519-Jul-09 19:42
meeram39519-Jul-09 19:42 
GeneralRe: FileUploading gives error on Production Server Pin
Abhijit Jana19-Jul-09 19:47
professionalAbhijit Jana19-Jul-09 19:47 
AnswerRe: FileUploading gives error on Production Server Pin
N a v a n e e t h19-Jul-09 22:25
N a v a n e e t h19-Jul-09 22:25 
QuestionDataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Coupon_Info'. Pin
haleemasher19-Jul-09 18:23
haleemasher19-Jul-09 18:23 
QuestionPOST and GET Method Pin
syaiful_8619-Jul-09 16:14
syaiful_8619-Jul-09 16:14 
AnswerRe: POST and GET Method Pin
Abhijit Jana19-Jul-09 18:09
professionalAbhijit Jana19-Jul-09 18:09 
GeneralRe: POST and GET Method Pin
syaiful_8622-Jul-09 14:28
syaiful_8622-Jul-09 14:28 
Questionhow do put java applet and slideshow in asp.net Pin
ashutosh_karna19-Jul-09 8:10
ashutosh_karna19-Jul-09 8:10 
AnswerRe: how do put java applet and slideshow in asp.net Pin
Abhijit Jana19-Jul-09 8:15
professionalAbhijit Jana19-Jul-09 8:15 
QuestionHow to save webpage to client machine in asp.net Pin
ashutosh_karna19-Jul-09 8:02
ashutosh_karna19-Jul-09 8:02 
AnswerRe: How to save webpage to client machine in asp.net Pin
Abhijit Jana19-Jul-09 8:20
professionalAbhijit Jana19-Jul-09 8:20 
GeneralRe: How to save webpage to client machine in asp.net Pin
ashutosh_karna19-Jul-09 8:32
ashutosh_karna19-Jul-09 8:32 
AnswerRe: How to save webpage to client machine in asp.net Pin
Christian Graus19-Jul-09 14:02
protectorChristian Graus19-Jul-09 14:02 
QuestionCalling Button_click event from Tab key_press event Pin
ashutosh_karna19-Jul-09 7:54
ashutosh_karna19-Jul-09 7:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.