CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: file uploading

  1. #1
    Join Date
    Mar 2007
    Posts
    77

    Question file uploading

    hi all

    I m trying to upload jpg file. using this code
    i m using vs2005
    Code:
     if (IsValid && InputFile1.HasFile)
            {
                if (InputFile1.FileContent.Length <=5000000  && InputFile1.FileContent.Length > 0)
                {
                    try
                    {
                        string filename = InputFile1.FileName;
                        string fileextension = Path.GetExtension(filename);
                        InputFile1.MoveTo(Path.Combine(apppath, "video\\org_video\\" + InputFile1.FileName), MoveToOptions.Overwrite);
                    }
                    catch (Exception ex)
                    {
                        Response.Write(ex.Message );
                    }
                    
                }
                else
                {
                    Label2 .Text =" the file is above 50 Mb";
                }
            }
    when i run this code i m getting error "The process cannot access the file 'C:\Documents and Settings\admin\Local Settings\Temp\61e30ac62cc343ee8506f0c697834f95' because it is being used by another process.
    "
    please help me.

  2. #2
    Join Date
    Jan 2008
    Posts
    47

    Re: file uploading

    Give full code, including declarative syntax for file control declarion

  3. #3
    Join Date
    Aug 2008
    Posts
    70

    Re: file uploading

    forget all and try this link

    http://forums.asp.net/t/1337576.aspx
    VB.Net 2005, Net Framework 2.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured