473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File download dialog box

ak1dnar
1,584 Expert 1GB
Hi,
How to display a file download dialog box using PHP. is there any header for this.
Currently i have uploaded some .pdf and .doc files to the web site.
Now i need to give the download links to the users. i can make the script to get the path of the files.

http://www.mydomain.com/file_folder/any_file.pdf

i can make the links like this, but the problem is then these pdf files will open with the browser window.Not a download dialog box.
Mar 14 '07 #1
4 3257
Yes, it is the header function. Could I suggest http://uk2.php.net/manual/en/function.header.php , has many examples of what you're trying to achieve. I've used those methods in enabling the user to download a CSV file, created by a PHP script.
Mar 14 '07 #2
Hi

It is true pdf file wil automatically open the by ur browser...What you can do is rename the extension .pdf to .zip and it will download the file and the dialog box but make sure that you inform the user once downloaded rename it back to .pdf...just another idea

lorener...

p.s

Is there anyone can share an email form with file attachement in flash?
Mar 15 '07 #3
ak1dnar
1,584 Expert 1GB
Hi

It is true pdf file wil automatically open the by ur browser...What you can do is rename the extension .pdf to .zip and it will download the file but make sure that you inform the user once downloaded rename it back to .pdf...just another idea

lorener...

p.s

Is there anyone can share an email form with file attachement in flash?
Read this Thread Buddy,I have already made it. Nothing is Impossible.Simple Bugs are there to Fix.
Now i am working on.
Mar 15 '07 #4
ak1dnar
1,584 Expert 1GB
Yes, it is the header function. Could I suggest http://uk2.php.net/manual/en/function.header.php , has many examples of what you're trying to achieve. I've used those methods in enabling the user to download a CSV file, created by a PHP script.
Thanks for the Link. Please Read This Thread . Have you tried to Trap the Error message in your CSV download Script.
Mar 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: peetm | last post by:
I'd like to write to a log whenever a visitor to my site downloads a file. So, I'd like the link they click to be to a php 'page' that returns the file. Don't know how to do that! Side...
0
by: Buddy Ackerman | last post by:
I am trying to implment a file download via a link such that when clicked, instead of starting the default application for that type of file the user will be presented with a download dialog...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
5
by: Brad | last post by:
In several aspx applications I export crytal reports to pdf, xls and doc files and then the aspx page writes the selected export file to the client browser. This all works with one small quirk: ...
4
by: Nathan Sokalski | last post by:
I want to give visitors to my site the option of downloading a generated ..txt file by clicking a button. I know how to generate text files, but how do I cause the browser to pop up one of those...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
4
by: Jonny | last post by:
Hello Group How do I open a Save File Dialog from an ASPX page behind a browse button? Any help would be fantastic!! I am using ASP.NET 1.1 using VB.NET as the coding language TIA
1
by: sunita | last post by:
Hiii I open a file download dialog from a modal dialog...From the file download dialog i can either save or open the file.. Is there a way i can let the modal dialog that opens the file download...
1
by: RN1 | last post by:
In an ASP.NET app, users can upload their files to a remote server as back-up. I want to give users the provision to download files that they have uploaded to the remote server to their local...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.