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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. how Upload pdf file ?

how Upload pdf file ?

Scheduled Pinned Locked Moved ASP.NET
helpquestion
5 Posts 5 Posters 3 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.
  • S Offline
    S Offline
    Suhail Ali
    wrote on last edited by
    #1

    I need help how upload pdf file. Sohail Ali

    N J S 3 Replies Last reply
    0
    • S Suhail Ali

      I need help how upload pdf file. Sohail Ali

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Suhail Ali wrote: I need help how upload pdf file. File upload control ?:~


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • S Suhail Ali

        I need help how upload pdf file. Sohail Ali

        J Offline
        J Offline
        Jon Sagara
        wrote on last edited by
        #3

        There are many ways[^]. Google is your friend. There's even an article on CP[^].

        Jon Sagara Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined! -- Dr. Zoidberg .NET Blog | Personal Blog | Articles

        B 1 Reply Last reply
        0
        • J Jon Sagara

          There are many ways[^]. Google is your friend. There's even an article on CP[^].

          Jon Sagara Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined! -- Dr. Zoidberg .NET Blog | Personal Blog | Articles

          B Offline
          B Offline
          bryan paling
          wrote on last edited by
          #4

          here's a tip (C#) Dim theFullyQualifiedPath As System.String = "" Dim Dir as System.String = "" theFullyQualifiedPath = Me._root_path & "\" & System.IO.Path.GetFileName(Me.FileUpload.PostedFile.FileName) Dir = "the directory on the site(url)" Dim strFileName as string strFileName = FileUpload.PostedFile.FileName Dim strFile as string strFile = System.IO.Path.GetFileNameWithoutExtension(strFileName) Dim strExtension as string strExtension = System.IO.Path.GetExtension(strFileName) Dim FullPath as string FullPath = Dir & strFile & strExtension hope this helps... :-D

          --- If the facts don't fit the Theory, change the facts...

          1 Reply Last reply
          0
          • S Suhail Ali

            I need help how upload pdf file. Sohail Ali

            S Offline
            S Offline
            Sathesh Sakthivel
            wrote on last edited by
            #5

            It's simple: just use the following ready-to-run code snippets, passing in your File Field control as an argument. Each function will return just the information you want to feed straight into your database, from a byte array for the image field to a string for the file type. Public Function GetByteArrayFromFileField( _ ByVal FileField As System.Web.UI.HtmlControls.HtmlInputFile) _ As Byte() ' Returns a byte array from the passed ' file field controls file Dim intFileLength As Integer, bytData() As Byte Dim objStream As System.IO.Stream If FileFieldSelected(FileField) Then intFileLength = FileField.PostedFile.ContentLength ReDim bytData(intFileLength) objStream = FileField.PostedFile.InputStream objStream.Read(bytData, 0, intFileLength) Return bytData End If End Function Public Function FileFieldType(ByVal FileField As _ System.Web.UI.HtmlControls.HtmlInputFile) As String ' Returns the type of the posted file If Not FileField.PostedFile Is Nothing Then _ Return FileField.PostedFile.ContentType End Function Public Function FileFieldLength(ByVal FileField As _ System.Web.UI.HtmlControls.HtmlInputFile) As Integer ' Returns the length of the posted file If Not FileField.PostedFile Is Nothing Then _ Return FileField.PostedFile.ContentLength End Function Public Function FileFieldFilename(ByVal FileField As _ System.Web.UI.HtmlControls.HtmlInputFile) As String ' Returns the core filename of the posted file If Not FileField.PostedFile Is Nothing Then _ Return Replace(FileField.PostedFile.FileName, _ StrReverse(Mid(StrReverse(FileField.PostedFile.FileName), _ InStr(1, StrReverse(FileField.PostedFile.FileName), "\"))), "") End Function

            SSK.

            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