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. PDF Upload

PDF Upload

Scheduled Pinned Locked Moved ASP.NET
asp-netcomhelp
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.
  • T Offline
    T Offline
    Taurian110
    wrote on last edited by
    #1

    Hello Ever one: This article http://www.codeproject.com/aspnet/fileupload.asp[[^](http://www.codeproject.com/aspnet/fileupload.asp [^] "New Window")] works for .txt file and images but its not working for .PDF or .DOC or .XLS files, could someone please help me modify the code so I can upload .PDF Files also! Thanks..

    C A 2 Replies Last reply
    0
    • T Taurian110

      Hello Ever one: This article http://www.codeproject.com/aspnet/fileupload.asp[[^](http://www.codeproject.com/aspnet/fileupload.asp [^] "New Window")] works for .txt file and images but its not working for .PDF or .DOC or .XLS files, could someone please help me modify the code so I can upload .PDF Files also! Thanks..

      C Offline
      C Offline
      Craigpt
      wrote on last edited by
      #2

      Probably best thing to do would be to e-mail the author of that article. S/He'd probably be the best to come up with an answer for that, and they can update their article to include that relevant information.

      1 Reply Last reply
      0
      • T Taurian110

        Hello Ever one: This article http://www.codeproject.com/aspnet/fileupload.asp[[^](http://www.codeproject.com/aspnet/fileupload.asp [^] "New Window")] works for .txt file and images but its not working for .PDF or .DOC or .XLS files, could someone please help me modify the code so I can upload .PDF Files also! Thanks..

        A Offline
        A Offline
        Albert Pascual
        wrote on last edited by
        #3

        ContentType – MIME type of uploaded file, i.e. “image/gif” Change that in the code to the type pdf or any other type you need. Hope this helps Al

        T 1 Reply Last reply
        0
        • A Albert Pascual

          ContentType – MIME type of uploaded file, i.e. “image/gif” Change that in the code to the type pdf or any other type you need. Hope this helps Al

          T Offline
          T Offline
          Taurian110
          wrote on last edited by
          #4

          Do you mean something like this:

          row["FileName"]		=	sName;
          row["FileSize"]		=	buffer.Length;
          row["FileData"]		=	buffer;
          row["ContentType"] 	=	image/pdf;
          

          Thank you for your reply.

          A 1 Reply Last reply
          0
          • T Taurian110

            Do you mean something like this:

            row["FileName"]		=	sName;
            row["FileSize"]		=	buffer.Length;
            row["FileData"]		=	buffer;
            row["ContentType"] 	=	image/pdf;
            

            Thank you for your reply.

            A Offline
            A Offline
            Albert Pascual
            wrote on last edited by
            #5

            Well yes and no, there is not type as image/pdf you need to use document/pdf I believe on top of my head. Al

            T 1 Reply Last reply
            0
            • A Albert Pascual

              Well yes and no, there is not type as image/pdf you need to use document/pdf I believe on top of my head. Al

              T Offline
              T Offline
              Taurian110
              wrote on last edited by
              #6

              Thanks, I got it working :-D

              A 1 Reply Last reply
              0
              • T Taurian110

                Thanks, I got it working :-D

                A Offline
                A Offline
                Albert Pascual
                wrote on last edited by
                #7

                Hope with my help ;-) Cheers Al

                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