save image in backfolder

Discussion in 'ASP General' started by vinodkus@gmail.com, Dec 3, 2008.

  1. Guest

    dear sir/madam

    please tell me how to save image or any file in back folder in asp

    i am doing like this but it is not working

    path = Server.Mappath("../NewsImage")&"/"&Names
    fields("imageLarge").value.SaveAS path
    NewsImage folder is before controlpanel
    and the page which contain this code is in controlpanel

    but it is giving error in server.mappath .. is not allowed

    Thanks in advance
     
    , Dec 3, 2008
    #1
    1. Advertising

  2. wrote on Tue, 2 Dec 2008 22:41:14 -0800 (PST):

    > dear sir/madam


    > please tell me how to save image or any file in back folder in asp


    > i am doing like this but it is not working


    > path = Server.Mappath("../NewsImage")&"/"&Names
    > fields("imageLarge").value.SaveAS path
    > NewsImage folder is before controlpanel and the page which contain this
    > code is in controlpanel


    > but it is giving error in server.mappath .. is not allowed


    > Thanks in advance


    Either don't use .. in the path name, or change your IIS configuration to
    allow .. in path names (parent paths).

    If for instance NewsImage is straight off the root, use

    Server.MapPath("/NewsImage") instead

    otherwise use the appropriate relative path to the root of the site.

    --
    Dan
     
    Daniel Crichton, Dec 3, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike John
    Replies:
    0
    Views:
    539
    Mike John
    Jul 28, 2003
  2. user
    Replies:
    1
    Views:
    797
    Bruce Barker
    Apr 4, 2005
  3. teo
    Replies:
    1
    Views:
    491
  4. Daniel Mark
    Replies:
    1
    Views:
    792
    Fredrik Lundh
    Sep 25, 2006
  5. dodgeyb
    Replies:
    1
    Views:
    630
    George Ter-Saakov
    Dec 14, 2007
Loading...

Share This Page