hello all i m ashutosh rath from mumbai working as a junior programmer in c#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashutosh rath
    New Member
    • Mar 2008
    • 1

    hello all i m ashutosh rath from mumbai working as a junior programmer in c#

    i want to upload only zip files by c#, the format of file should be "ab_data.zi p" format (start from 2 char thn one underscore thn after 4 chars)

    my code is.......

    string fileNameText = null;
    string fileextension;
    filename = Fileuploading.V alue.ToString() .Trim();

    if (Fileuploading. PostedFile!=nul l)
    {
    if(Fileuploadin g.PostedFile.In putStream.Lengt h > 0)
    {
    fileextension = Path.GetExtensi on(filename.ToS tring().ToLower ()); if(fileextensio n != ".zip")
    {
    //error message;

    }
    else
    {
    fileNameText=fi lename.Substrin g(filename.Last IndexOf(directo ryseperater)+1, filename.Length-(filename.LastI ndexOf(director yseperater)+ 1));
    Fileuploading.P ostedFile.SaveA s(Request.MapPa th("/AspNetLearn/Upload")+ "//"+ fileNameText);
    filepath = ("/AspNetLearn/Upload") + "/" + fileNameText ;
    //message success;
    }
    }
    }



    plzzzz anyone help me...
Working...