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. Advertisements

  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. Advertisements

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:
    696
    Mike John
    Jul 28, 2003
  2. user
    Replies:
    1
    Views:
    945
    Bruce Barker
    Apr 4, 2005
  3. teo
    Replies:
    1
    Views:
    616
  4. Daniel Mark
    Replies:
    1
    Views:
    1,081
    Fredrik Lundh
    Sep 25, 2006
  5. BusyBoy
    Replies:
    2
    Views:
    793
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 31, 2006
  6. subhadip
    Replies:
    0
    Views:
    776
    subhadip
    Mar 28, 2007
  7. dodgeyb
    Replies:
    1
    Views:
    745
    George Ter-Saakov
    Dec 14, 2007
  8. hell2heaven
    Replies:
    0
    Views:
    548
    hell2heaven
    Oct 26, 2008
Loading...