Uploading a directory instead of a file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K Viltersten

    Uploading a directory instead of a file

    I'd like to allow a user to point out a directory. There's facility for
    pointing to a file, FileUpload, but there's nothing to get the path to a
    given folder. How can that be solved (Silverlight is not an option).

    Konrad Viltersten
  • K Viltersten

    #2
    Re: Uploading a directory instead of a file

    I'd like to allow a user to point out a directory. There's facility for
    pointing to a file, FileUpload, but there's nothing to get the path to a
    given folder. How can that be solved (Silverlight is not an option).
    >
    Konrad Viltersten
    In fact, as we're on the subject, when i get the information using
    FileUploader.Fi leName
    i only get the actual name and not the path. What i do need is the path,
    acutally. The name itself is just an extra info. How can i get what i need?


    --
    Konrad Viltersten

    Comment

    • K Viltersten

      #3
      Re: Uploading a directory instead of a file

      Den 2008-05-07 09:23:40 skrev K Viltersten <tmp1@vilterste n.com>:
      >I'd like to allow a user to point out a directory. There's facility for
      >pointing to a file, FileUpload, but there's nothing to get the path to
      >a given folder. How can that be solved (Silverlight is not an option).
      >>
      >Konrad Viltersten
      >
      In fact, as we're on the subject, when i get the information using
      FileUploader.Fi leName
      i only get the actual name and not the path. What i do need is the path,
      acutally. The name itself is just an extra info. How can i get what i
      need?
      As i read my post i realize that someone will soon give me the (indeed
      correct) information to use PostedFile.File Name. Is this the correct way
      of obtaining the full path? Since no file has been uploaded on my system
      (only a path has been obtained), i feel a future issues arise. Is it a
      recommended way?

      P.S.
      Sorry for the scattered posting. Too much/little coffee, i say. :)

      Konrad Viltersten

      Comment

      • Mark Fitzpatrick

        #4
        Re: Uploading a directory instead of a file

        Unfortunately, the path isn't going to do you any good at all. All you can
        get is a file, not a directory. The upload control can only upload a single
        file at a time because that's what the RFC for handling file upload on the
        web specify. You can't access the filepath that exists on the user's machine
        so that won't help since all you have access to is the file they select, and
        some information about it.

        To get around this would take an aweful lot of work as you would have to do
        something drastic such as resort to WPF, a winform embedded in the browser,
        or a custom browser add-in. None of these are really good solutions though
        as they would be difficult and expensive to implement, not to mention would
        probably annoy users if they had to do things such as download the .net
        framework to run a winform.

        Hope this helps,
        Mark Fitzpatrick
        Microsoft MVP - Expression

        "K Viltersten" <tmp1@vilterste n.comwrote in message
        news:op.uarwp9j ni74t80@lp028.p agero.local...
        Den 2008-05-07 09:23:40 skrev K Viltersten <tmp1@vilterste n.com>:
        >
        >>I'd like to allow a user to point out a directory. There's facility for
        >>pointing to a file, FileUpload, but there's nothing to get the path to
        >>a given folder. How can that be solved (Silverlight is not an option).
        >>>
        >>Konrad Viltersten
        >>
        >In fact, as we're on the subject, when i get the information using
        >FileUploader.F ileName
        >i only get the actual name and not the path. What i do need is the path,
        >acutally. The name itself is just an extra info. How can i get what i
        >need?
        >
        As i read my post i realize that someone will soon give me the (indeed
        correct) information to use PostedFile.File Name. Is this the correct way
        of obtaining the full path? Since no file has been uploaded on my system
        (only a path has been obtained), i feel a future issues arise. Is it a
        recommended way?
        >
        P.S.
        Sorry for the scattered posting. Too much/little coffee, i say. :)
        >
        Konrad Viltersten
        >

        Comment

        • K Viltersten

          #5
          Re: Uploading a directory instead of a file

          Unfortunately, the path isn't going to do you any good at all. All you
          can get is a file, not a directory. The upload control can only upload a
          single file at a time because that's what the RFC for handling file
          upload on the web specify. You can't access the filepath that exists on
          the user's machine so that won't help since all you have access to is
          the file they select, and some information about it.
          >
          To get around this would take an aweful lot of work as you would have to
          do something drastic such as resort to WPF, a winform embedded in the
          browser, or a custom browser add-in. None of these are really good
          solutions though as they would be difficult and expensive to implement,
          not to mention would probably annoy users if they had to do things such
          as download the .net framework to run a winform.
          >
          Hope this helps,
          Mark Fitzpatrick
          Microsoft MVP - Expression
          It didn't help but at least i know where i'm standing, hehe.

          Thanks!

          Konrad Viltersten

          Comment

          • Mark Rae [MVP]

            #6
            Re: Uploading a directory instead of a file

            "K Viltersten" <tmp1@vilterste n.comwrote in message
            news:op.uarvave ui74t80@lp028.p agero.local...
            I'd like to allow a user to point out a directory. There's facility for
            pointing to a file, FileUpload, but there's nothing to get the path to a
            given folder.
            You can't do this natively.
            How can that be solved
            Very simply: http://www.utechsoft.com/products/uupload/
            (Silverlight is not an option).
            Why not...?


            --
            Mark Rae
            ASP.NET MVP


            Comment

            • K Viltersten

              #7
              Re: Uploading a directory instead of a file

              >I'd like to allow a user to point out a directory. There's facility for
              >pointing to a file, FileUpload, but there's nothing to get the path to
              >a given folder.
              >
              You can't do this natively.
              Bad news. Thanks anyway!
              >How can that be solved
              >
              Very simply: http://www.utechsoft.com/products/uupload/
              >
              >(Silverlight is not an option).
              >
              Why not...?
              Project specification. The solution must not require any additional
              installations and this far, sadly, if i may say so, Silverlight is not as
              spread as to be regarded a standard. Even sadlier, i can not use the
              UTechSoft solution either, as the requirement is to code the project using
              MS products solely. Nevertheless, good info. Thanks!

              Konrad Viltersten


              Comment

              • Mark Rae [MVP]

                #8
                Re: Uploading a directory instead of a file

                "K Viltersten" <tmp1@vilterste n.comwrote in message
                news:op.uar16v1 ji74t80@lp028.p agero.local...
                as the requirement is to code the project using MS products solely
                That is really short-sighted, IMO...

                Whenever I've been faced with a similar situation in the past, my usual
                response is "No problem - it will probably take me several months to develop
                what you want, at my standard daily rate. Alternatively, you can have it
                this afternoon for a few hundred dollars..."


                --
                Mark Rae
                ASP.NET MVP


                Comment

                • Shane43

                  #9
                  Re: Uploading a directory instead of a file

                  On May 7, 2:45 am, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
                  "K Viltersten" <t...@vilterste n.comwrote in message
                  >
                  news:op.uar16v1 ji74t80@lp028.p agero.local...
                  >
                  as the requirement is to code the project using MS products solely
                  >
                  That is really short-sighted, IMO...
                  >
                  Whenever I've been faced with a similar situation in the past, my usual
                  response is "No problem - it will probably take me several months to develop
                  what you want, at my standard daily rate. Alternatively, you can have it
                  this afternoon for a few hundred dollars..."
                  >
                  --
                  Mark Rae
                  ASP.NET MVPhttp://www.markrae.net
                  I strongly agree with Mark on this one. Perhaps you should go back to
                  your customer and figure out what they really want, not what they
                  THINK they want...big difference...I' ve seen customers that
                  mandate .NET, or SOA, when all they really needed was a simple
                  javascript solution - they just thought they wanted the latest and
                  greatest buzzwords.

                  Good luck!
                  Shane

                  Comment

                  Working...