Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. saving path problem, please help.

saving path problem, please help.

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasehelpsysadmin
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Farraj
    wrote on last edited by
    #1

    Hi, I have a database (access) that contains a table GALLERY. Now i need while uploading a file to insert the path in this way to the db "~/photo/XXX.JPG" What i get right now is only the file's name. This is what i used for saving the path FileUpload1.SaveAs(Server.MapPath("~/photo/" + FileUpload1.FileName)); I've tried it with and without the Server.MapPath. The resault without the server.mappath was "The SaveAs method is configured to require a rooted path..bla bla bla" With the Server.MapPath it works but not the way i need it. as i said it inserts only the file's name to the DB. Can anyone please help me with that. Thank you, Basil.

    N L 2 Replies Last reply
    0
    • F Farraj

      Hi, I have a database (access) that contains a table GALLERY. Now i need while uploading a file to insert the path in this way to the db "~/photo/XXX.JPG" What i get right now is only the file's name. This is what i used for saving the path FileUpload1.SaveAs(Server.MapPath("~/photo/" + FileUpload1.FileName)); I've tried it with and without the Server.MapPath. The resault without the server.mappath was "The SaveAs method is configured to require a rooted path..bla bla bla" With the Server.MapPath it works but not the way i need it. as i said it inserts only the file's name to the DB. Can anyone please help me with that. Thank you, Basil.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Do not post to multiple forum :mad:


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • F Farraj

        Hi, I have a database (access) that contains a table GALLERY. Now i need while uploading a file to insert the path in this way to the db "~/photo/XXX.JPG" What i get right now is only the file's name. This is what i used for saving the path FileUpload1.SaveAs(Server.MapPath("~/photo/" + FileUpload1.FileName)); I've tried it with and without the Server.MapPath. The resault without the server.mappath was "The SaveAs method is configured to require a rooted path..bla bla bla" With the Server.MapPath it works but not the way i need it. as i said it inserts only the file's name to the DB. Can anyone please help me with that. Thank you, Basil.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What database are you using. If your database generate the problem on saving the file path. You can Encrypt the path and Then save to it.

        If you can think then I Can.

        F 1 Reply Last reply
        0
        • L Lost User

          What database are you using. If your database generate the problem on saving the file path. You can Encrypt the path and Then save to it.

          If you can think then I Can.

          F Offline
          F Offline
          Farraj
          wrote on last edited by
          #4

          im using an ACCESS DB, what do you mean by encrypting the path

          L 1 Reply Last reply
          0
          • F Farraj

            im using an ACCESS DB, what do you mean by encrypting the path

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            If you are using Access DB then replace the \ to \\ and save it. the second method is to save in database is encrypt the path.

            If you can think then I Can.

            F 1 Reply Last reply
            0
            • L Lost User

              If you are using Access DB then replace the \ to \\ and save it. the second method is to save in database is encrypt the path.

              If you can think then I Can.

              F Offline
              F Offline
              Farraj
              wrote on last edited by
              #6

              thanks for your answer, please tell me what do you mean by encrypting the path, you mean to encrypt the path string before inserting to the DB, how would i do that ?

              L 1 Reply Last reply
              0
              • F Farraj

                thanks for your answer, please tell me what do you mean by encrypting the path, you mean to encrypt the path string before inserting to the DB, how would i do that ?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                If your Path Name have a Special Character that database is not support. Then you can use to convert this path to a another string by using diffrent encryption method.

                If you can think then I Can.

                F 1 Reply Last reply
                0
                • L Lost User

                  If your Path Name have a Special Character that database is not support. Then you can use to convert this path to a another string by using diffrent encryption method.

                  If you can think then I Can.

                  F Offline
                  F Offline
                  Farraj
                  wrote on last edited by
                  #8

                  i need you to tell me HOW to encrypt it

                  L 1 Reply Last reply
                  0
                  • F Farraj

                    i need you to tell me HOW to encrypt it

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Check this Article Encrypt and Decrypt a String[^]

                    If you can think then I Can.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups