Hey Guys, Looking for a solution (preferably free) for uploading and viewing files (pdf mainly). Is there a component or behaviour that I can download for dreamweaver that will allow me to setup an upload form which uploads to the database and then subsequently displays on a page within my website. Or is there some snippets of code which will do this? Thanks very much in advance! Mr Desperate
I think you can upload pdf files normally like other files. No special code will be required to upload pdf files... Also displaying pdf files is usually done by the browser so again no special code will be required to display a pdf .... If you want to store a pdf file in database, you can store the file in the file sysytem and then store the path to the file in the database...
In ASP.net in VS you just drop the FileUpload control from the toolbox on the webpage something like this: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="showpdf._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:FileUpload ID="FileUpload1" runat="server" /><asp:Button ID="Button1" runat="server" Text="Button" /> </div> <asp:Literal ID="Literal1" runat="server"></asp:Literal> </form> </body> </html> and in the code behind you do: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click If Not String.IsNullOrEmpty(Me.FileUpload1.FileName) Then Dim myFile As HttpPostedFile = FileUpload1.PostedFile Dim p As String = Server.MapPath(".") myFile.SaveAs(p & "\test.pdf") Me.Literal1.Text = "<a href=""test.pdf"">show PDF<a/>" End If End Sub Is this what you are looking for?
if its classic asp heres a good free tool : http://asp-upload.motobit.com/ with easy to follow examples etc.. cheers,dave.