Downloading Or Opening A File In Asp

I want to create a asp page where i can give the user an option of downloading a file or opening a file e.g an excel file.

How do i do this?? Ive already created an asp page which has a button- where the user can click on the button. The excel option of either opening the file or downloading it comes up- but i want this option actually on a asp page. How do I go about this?

View Replies


ADVERTISEMENT

ASP Pages Downloading Instead Of Opening

I am working on a new website using .asp as the format and for some reason when I use firefox or IE to view the pages, I will be given the option to download the file instead of just opening the file in the browser.

The pages have been uploaded to test directory on a server that I use for development. The other pages that are my actual site that are asp pages work fine.

Any ideas?

View Replies View Related

Downloading A File

There any way to download files I'm keeping stored above the www
folder for security

I'm thinking of the following : My script determines what file the user
requests, checks their credentials, and then "forwards" the file from the
non public directory to the user.

View Replies View Related

Downloading Pdf File

From the client side, I want to download a pdf file from the server side that was initially saved there.

this site didnt work for me: ....

View Replies View Related

Downloading A File

I have a download function that allows a site visitor to download a file. It works when the page that calls the function, the function, and the file to download are all in the same folder. I want to be able to have the page that calls in one folder, the function in another folder and the file in a third. Any advice? Code that is working when all three are together:

Function doDownload (fileName)
dim myAttachment
myAttachment = "attachment; filename=" & fileName
Response.AddHeader "Content-Disposition", myAttachment
Response.ContentType = "application"
response.BinaryWrite fileName

End Function

View Replies View Related

You Are Downloading The File

I have an asp script on a server. However whenever I link to the script, instead of running it, the browser displays a message saying. "You are downloading the file "filename" from "server name" Would you like to open this file or save it to your computer ?

View Replies View Related

How To Secure File Downloading

I have been lately dealing with developing an ASP based web application which uploads documents to a folder. Application itself is password protected by the session.

I am now looking for securing the documents that are uploaded.

For example;

Let's say AAA.doc is uploaded to "/docs" folder by this password-protected application. But, I can't prevent the following link to download this Word document:

(URL address blocked: See forum rules)

How can I prevent the above link to download AAA.doc? Is it something possible to restrict it with a session variable? I also want the user who are authenticated at the beginning to view or download the file, but unauthenticated users shouldn't view it.

I found some articles but they are speaking about IIS level things. Folders may be created dynamically. Is it possible to have this security feature at application level?

View Replies View Related

Problem With File Downloading Using Asp

I have written code to download the file stored in the database.

according to some condition the data in database is written using binary write.

If Not rs.EOF Then
Response.ContentType = rs("Content Type")
Response.BinaryWrite rs("File Data")
End If

but when i try to write some filles other than pictures, it will prompt to save the asp file. Code:

View Replies View Related

Downloading Zip File As Binary File

I use the following code in an asp.net page to download file from my site to the user:

Response.Buffer = True
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=""" & dsDocFile.Tables("tbl_DocFile").Rows.Find(FileID).Item("FileName") & """")
Response.Flush()
Response.WriteFile(sFileName)

This works with most every file type I've run across (jpg, gif, doc, ppt, xls, etc..). Normally when the user tries to access a file, a download window pops up asking the user whether he/she wants to open or save the file.

However, when the file is a zip file, the user just receives a blank screen instead of the usual download window. Has any one run into this problem? If yes, how did you resolve it?

View Replies View Related

File Downloading Problem In Firefox.

i am having prob while downloading a file in firefox. If the filename contains
spaces it takes only name before the first space. The rest of the part in the filename is egnored....

i use the following code for it.
--
Response.Addheader "Content-Disposition", "attachment; filename=" & filename
----
example if the filename is "sample filename.doc". while downloading it saves as "sample" the rest of the part filename.doc is removed.

The above code works fine in IE. Can anyone here tell me how i can handle this in firefox v1.

View Replies View Related

Downloading A File From A Folder Above Webroot

I am currently working on an ASP based site which displays largely numerical data, which is stored in an access database. I have been asked to create an 'export' page, which, when working properly will allow a user of the site to export the table he or she is looking at and export it to a .CSV file which they can save onto their own machine.

My problem lies here, I can create the .CSV file on the server, BUT permissions on our host are such that the file can only be saved to the 'databases' folder and not on the webroot.

Is there any way in which I can either setup a way for the user to download from the databases folder? or rather than creating the file on the server, directly write the file to the user's machine?

View Replies View Related

How To Avoid Downloading A File Directly From Webserver ?

I need to provide a way to download a software and its corresponding
manual from a web page.

So far I have done the sign in page where people give their data. I
will then give access to a page with a link allowing to download the
required file(s).

My worry is how to avoid that somebody grabs the URL of the file and
send it to another for downloading directly from the server. What can
I do to avoid this ?

View Replies View Related

How To Redirect The User To New Page After Downloading An Mp3 File

I have set of mp3 files as a list (DownloadFiles.asp). The user can click on any of the mp3 files to download(Download_Porcess.asp).After downloading the file the user has to redirect to the DownloadFiles.asp.

For this i used:

response.contenttype="audio/mpeg3",
response.binarywrite("binarystreamofmp3file)

In Download_Process.asp to force the save dialog box. This works fine. This allows the user to download the file. After downloading this mp3 file, this file should not be displayed in the list ie in (DownloadFiles.asp).

How can i do this?

I am not able to redirect from Download_Process.asp to DownloadFiles.asp, b'coz I used response.binarywrite.

View Replies View Related

Opening A File

I have a drop down on a page where user selects a value and then a excel file opens up
it works good in mozilla but in IE it doesnt open up the excel file i see a new page been open but then suddenly it closes the file
i have checked the popus in IE and i dont know what the problem is
Here is the code Code:
<%
Response.ContentType ="application/vnd.ms-excel"
getid=Trim(Request.querystring("id"))
Response.write getid
%>
I see the output written when i use mozilla but it just doesnt work in IE.

View Replies View Related

File Opening

From a LINK or BUTTON on a webpage can we invoke the usual OPEN FILE dialog box that come with all the windows application .

In my Application I want to ASK the user the Name of a FILE on the disk ... currently i am asking the user to input the COMPLETE PATH in a TEXTBOX ....

View Replies View Related

Opening .csv File

I need to incorporate some emails that are in a csv file, all sorted in one column, into a mySQL database.I dont find the way to open the CSV file in ADO

View Replies View Related

Opening A File

I have a configuration.txt file and would like to open that file in a browser for editing onclick of a button or hyperlink!! It is more than enough for me, if i just open the file as it is in a notepad itself, by clicking a link from the ASP code.

View Replies View Related

Unable To Browse Website While Downloading A File Using A Component

I've been trying to send a (large) file to the browser via a download
page that uses a file download component. The file downloads fine,
except that Internet Explorer refuses to browse to a different page
while the file is downloading! I don't understand why it does that
and I don't know how to fix this problem.

Any idea? Code:

View Replies View Related

Opening DB Connection In ASP File

I am trying to open a DB connection in an ASP file (with an HTML interface). I have some idea how to do it, but I am not quite sure. It is linking to an Access DB. It is very simple, I am posting some data to the DB. Only one connection is needed to open.

View Replies View Related

Opening File Problem

I have a field in the table that saves pdf file paths:

there are 2 records like this:

/docs/one.pdf
/docs/one&two.pdf

what i do is display the paths on the page and when people click on it the file is opened

this is how i display the paths

<a href="<%=RS("Path")%>"><%=titlename %></a>

the first file one.pdf opens up
the second file one&two.pdf doesnt open up

if i change the name of the path in the table to

/docs/onetwo.pdf it works

so i found out the & is causing the problems

can someone tell me how to fix it.

View Replies View Related

Opening File For Appending

I want to open a text file for appending purpose but it gives me the following error..

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument

/cgi-bin/Anagram_Utils/welcome_letter/generatedoc.asp, line 19

Code: ......

View Replies View Related

Opening Word File In Explorer

I want to open word file in explorer. I am using hyperlink for this purpose but it doesnt show me the file opened. Though i able to do save as on it.

View Replies View Related

Got Error In Dll While Opening The Excel File.

I have created one dynamic chart creation application using vb dll. If I call this function from vb it is working fine. But If i call this function from ASP i got error while opening the excel file line. I have windows 2000 server. Do i need to give any permission for this? The same coding is working fine in NT server.

View Replies View Related

Opening PDF Within IE7 - File Could Not Be Written To Cache

I have a page in in ASP which lists static links to PDF files. When
users click on the links, they receive the following message:

right-clicking on the link and selecting "save target as" generates
the following error message from IE7:
"The file could not be written to the cache"

Clicking the link, and selecting "save" from the resultant dialog
generates:
"Internet Explorer was not able to open this Internet site. The
requested site is either unavailable or cannot be found please try
again later"

This page works fine in Mozilla.
I've researched this a bit and have read about the caching issues,
although none of the pages on the site address cache control. Any
thoughts or ideas as to why this isn't working?

View Replies View Related

Page 2 - Opening DB Connection In ASP File

(incidentally, the more i look at it, the more i feel i should point out that to be totally sure your SQL statement is correct you should write it like:

INSERT INTO table_name (column1, column2,...)
VALUES (value1, value2,....)
so that you know your info is going to the right column on the table

View Replies View Related

Opening Word File From Hyperlink

I have a document saved to a public network server. The public directory grants change access to all users on the network. To keep my Word doc protected I am using the Security feature "File Sharing Options" in Word to attach a password to the document. This works as expected when users open the file with Windows Explorer.

I also have an ASP web page that has a link to my file on the public drive. When I click this link, the Word document loads without asking me for a password and is not read-only. (Note the link in formatted with an href attribute like this: file://servername/share/filename.doc)

Am I mssing something? Shouldn't the Word security work even if the file is accessed through a hyperlink?

View Replies View Related

Opening A Local File From A Hosted Link

I'm working on a document management app that saves scanned docs as PDF files in a local directory, then saves document metadata in an Internet-based SQL server.

The SQL server is then queried to retrieve document info and links are created that point to the files.

The code points to the proper local directory and file, but I can't get the browser to open the document in a target frame. If I open a test doc locally it works fine.

View Replies View Related

Permission Denied Error When Opening And Writing To File

I have a script that opens a file and writes to it using ASP. I've used the script before and it worked fine locally, until recently, after I upgraded my computer to Windows XP Pro SP2. Also, it still works fine when I upload the script to my web host. However, locally on my computer using IIS, I get the error:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied

This occurs on the line: Set FileTS = FileFSO.OpenTextFile(Server.MapPath(".") & "" & FileName,2,TRUE)

I've searched online for answers and most articles say I have to set read and write access to the containing folder. I have done so for the containing folder and for the entire "wwwroot" folder, but the problem still occurs. I have also allowed anonymous access for my computer IUSR_XXXXX. This doesn't work either.

View Replies View Related

Opening Server-side Excel File Then Modifying It Client Side Using Vbscript

is it possible to open an excel file (used as a template) from server using server-side vbscript; then modify it or add values from client using client-side vbscript?

View Replies View Related

Downloading PWS

I have a problem and it's pretty basic. I need to install PWS on a Windows NT Workstation 4.0 PC in college but cannot find a download just for PWS. I've done a search of the web and microsoft's download site and still no luck.

Installing IIS is not an option as Im technically not allowed to install anything and I'd rather it be PWS than a bigger and more noticeable IIS. I've heard that it comes on the Windows 98 disk but unfortuneatly I do not access to one.

Does anyone know of a link to download PWS? I've heard that it comes with an NT Option Pack aswell but can I just install PWS from this or will it change other settings?

View Replies View Related

Downloading Using ASP.

I've been searching through google and different script sites to try and locate a script for simply downloading files(Small video clips) from an access database to my web page. But have been unable to find what I am looking for.

Do any of you guy's know of any good scripts. Don't need anything fancy just the basics.

View Replies View Related

PDF Downloading

I'm using Infomentum's ActiveFile to download files. My machine is running Windows'98 and IE 5.5. I'm able to download all kinds of files except PDF files. I'm using the components File.Download method as per the example available in the web site and the directory that contains the file has sufficient rights granted, surprisingly I'm able to download those PDF files through OPERA.

I did not get any error when I go to the download, instead a blank page was displayed.

View Replies View Related

Uploading And Downloading In ASP

I'm creating the Intranet for my company and in one of the parts of it I want that users to be able to upload and download files, however, I'm not sure what would be the best option/application to use for its creation. I need them specially for the uploading to be able to track when was the upload done, which user did it, and so on.

I have been using ASPs to create the website. Could I do this with ASPs ?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved