Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2004, 01:01 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default What type of field/control for File attachments?

Hi-
I need to have a field on the form where people can attach a link to a pdf file or paste a URL link. What kind of field should be used in the database and on the form. Also, any related links/reading material would be highly appreciated.

Thanks
Renu
  #2 (permalink)  
Old August 20th, 2004, 09:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Renu,

Where do these PDFs files exist? Are they going to enter the URL/link to PDF file that exists on the webserver or on the internet?

Whatever, IMO, you can have a textbox where one can enter the URL to the PDF and the same can be stored in the DB as varchar/nvarchar with needed length. If the same required to be shown on the webpage, while displaying you can show that as

<a href="URL_That_Comes_FROM_DB">PDF NAME</a>

Hope I understood it right and that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
  #3 (permalink)  
Old August 22nd, 2004, 06:10 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay-
I found some code on the web for file upload and download.Right now to keep it simple I am not using any database. I am just uploading to the server and downloading from the server. The upload is working fine. However, for file download the dialog window is showing 2 times, I have to click on "Open" 2 times to actually open the pdf file. The "Save" option works fine. This is the only code in the imagebutton's click method. I am using an image button to view the file. Can you guess as to why clicking on open once does not work.


    Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        Dim objFileInfo As System.IO.FileInfo
        Dim strPhysicalPath As String
        strPhysicalPath = Server.MapPath("docbox.pdf")

        objFileInfo = New System.IO.FileInfo(strPhysicalPath)

        Response.ClearContent()
        Response.ClearHeaders()
        Response.ContentType = "application/pdf"
        Response.AppendHeader("Content-Disposition", "attachment; filename" + objFileInfo.FullName)
        Response.AddHeader("Content-Length", objFileInfo.Length.ToString())
        Response.WriteFile(objFileInfo.FullName)
        Response.Flush()
        Response.End()

    End Sub

Thanks!

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Queries On File Field Html Control in ASP.NET 1.1 daffodils ASP.NET 1.0 and 1.1 Basics 1 October 30th, 2006 11:30 AM
Can I create my own File Field control in ASP.Net vbmazza ASP.NET 1.0 and 1.1 Professional 1 February 22nd, 2006 11:45 AM
Convert "String" type to "Control" type ? kishore_peddi C# 4 January 11th, 2006 01:21 PM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM
Retrive text from input type field of html file?? bikash Javascript 10 July 30th, 2003 04:50 AM



All times are GMT -4. The time now is 04:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.