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. Web Development
  3. ASP.NET
  4. file upload and download with renaming

file upload and download with renaming

Scheduled Pinned Locked Moved ASP.NET
performancetutorialquestion
7 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.
  • H Offline
    H Offline
    hassan azizi
    wrote on last edited by
    #1

    hi i want to save renamed uploaded files in my site for example i save a.gif as 123423.aspx, right is it possible to show this image in browser without renaming it again with reponse.write or other technique (for example loading image in memory)? thanks

    T E 2 Replies Last reply
    0
    • H hassan azizi

      hi i want to save renamed uploaded files in my site for example i save a.gif as 123423.aspx, right is it possible to show this image in browser without renaming it again with reponse.write or other technique (for example loading image in memory)? thanks

      T Offline
      T Offline
      Tomas Petricek
      wrote on last edited by
      #2

      Hi, if you want to return gif image from aspx page you can use Response.WriteFile method (http://www.google.com/search?q=response+writefile[^] ). This method copies content of file (in this case gif image) to response stream. Because browser can't determinate what type of content you are sending you should also set Response.ContentType to "image/gif" (http://www.google.com/search?q=response+contenttype[^] ). But if you expect high load of your app this may not be best solution, because Response.WriteFile is slower than linking directly to image. Hth :)

      Tomas Petricek (Microsoft C# MVP)
      www.eeeksoft.net | Photos | ASP.NET Multi-column layout control

      1 Reply Last reply
      0
      • H hassan azizi

        hi i want to save renamed uploaded files in my site for example i save a.gif as 123423.aspx, right is it possible to show this image in browser without renaming it again with reponse.write or other technique (for example loading image in memory)? thanks

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        hi there, u can save the new name of the uploaded file in somewhere (e.g : DB) U therefore can retrive the new name and show this in browser without renaming just my thoughts << >>

        H 1 Reply Last reply
        0
        • E enjoycrack

          hi there, u can save the new name of the uploaded file in somewhere (e.g : DB) U therefore can retrive the new name and show this in browser without renaming just my thoughts << >>

          H Offline
          H Offline
          hassan azizi
          wrote on last edited by
          #4

          hi dear enjoycrack how can i do this ? plz tell me some detail thanks a lot

          E 1 Reply Last reply
          0
          • H hassan azizi

            hi dear enjoycrack how can i do this ? plz tell me some detail thanks a lot

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            hi hassan, ok let start as the following steps: 1. u save and rename the uploaded file in somewhere 2. then save the path of the file into DB 3. when user requests the web page, u only read the path from DB... hope this helps << >>

            H 1 Reply Last reply
            0
            • E enjoycrack

              hi hassan, ok let start as the following steps: 1. u save and rename the uploaded file in somewhere 2. then save the path of the file into DB 3. when user requests the web page, u only read the path from DB... hope this helps << >>

              H Offline
              H Offline
              hassan azizi
              wrote on last edited by
              #6

              hi enjoycrack let i explain what i need my client upload a.gif file to my site i rename it as 12332323.aspx (for unauthorized download and view) and save file original info in DB.when other user request it for download i want to place this aspx file to download without renaming it again to a.gif for this what can i do ? thanks

              E 1 Reply Last reply
              0
              • H hassan azizi

                hi enjoycrack let i explain what i need my client upload a.gif file to my site i rename it as 12332323.aspx (for unauthorized download and view) and save file original info in DB.when other user request it for download i want to place this aspx file to download without renaming it again to a.gif for this what can i do ? thanks

                E Offline
                E Offline
                enjoycrack
                wrote on last edited by
                #7

                hi sorry for my misunderstood. :-) To implement wat u need: anyway u must read the file a.gif from DB and then write byte stream to client, I think << >>

                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