473,466 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Content-Disposition: attachment; filename='' suggestst wrong filename

I have a script that i use for my downloadable files.
Bu when i try to download a file with IE it suggests a different
filename
than what i wrote in the code.

For example. If i try to download the file 'download.test.zip' it
suggests
'download[1].test.zip' instead.

I i use Mozilla Firefox to download the file it works fine...
And another question: what does the @-character before
require('includes/sys.dbconnect.php') really do? :)

I think i read it somewhere but i cant seem to remember what it
means...

Thanks

code:
-------------------------------------------------------------------------
<?php
if(IsSet($_GET['id']))
{
$fileid = $_GET['id'];
$query = "SELECT sFilename FROM tblFiles WHERE fileId=" . $fileid .
";";
$updatequery = "UPDATE tblFiles SET iHits=(iHits + 1) WHERE
fileId=" . $fileid . ";";
if(@require('includes/sys.dbconnect.php'))
{
if($result = mysql_query($query))
{
if($rad = mysql_fetch_array($result))
{
if(mysql_query($updatequery))
{
header('Content-type: application/x-download');
header('Content-Disposition: attachment; filename="' .
$rad[0] . '"');
header("Content-Length: " . filesize("../files/" .
$rad[0]));
readfile("../files/" . $rad[0]);
}
}
else
{
echo "The file does not exist.";
}
}
else
{
echo "SQL Error.";
}
}
}
else
{
header('Location: http://www.google.com');
}
exit();
?>
Jul 17 '05 #1
2 8892
spike wrote:
And another question: what does the @-character before
require('includes/sys.dbconnect.php') really do? :)


@ means not to display any errors that a function behind
it might display(encounter)...
So in this case if you do not have includes/sys.dbconnect.php
it will not display error/warning that you do not have it....

Tomy.
Jul 17 '05 #2
jo**@ljungh.se (spike) wrote in message news:<66**************************@posting.google. com>...
I have a script that i use for my downloadable files.
Bu when i try to download a file with IE it suggests a different
filename
than what i wrote in the code.

For example. If i try to download the file 'download.test.zip' it
suggests
'download[1].test.zip' instead.


This topic has been already discussed here. It seems to be a
problem with IE. Try to use only one period in the filename eg.
download.zip

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian Murphy | last post by:
I have a php-based yahoo-like web directory.I wanna give webmasters the possiblity to integrate my whole directory in their websites with their own formatting.I wanna this inclusion to be possible...
12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
3
by: Headless | last post by:
Should linking generated content work? Example: span:before{content:"foobar"} <a href="foobar.htm"><span></span></a> I stumbled across this bit in the CSS2 spec: >Generated content does...
2
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
11
by: Not4u | last post by:
Hello, I have a problem with CSS code. I want to have one menu column with a fixed width and a 100% height and the rest of the page for content. ---------------- |.|.|<--100%-->|...
0
by: Scott Abel | last post by:
For immediate release: The Rockley Group Content Management Workshop Series Coming to Atlanta, Seattle, Vancouver, Chicago, Washington, DC, Toronto, and Research Triangle Park Learn more:...
10
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be...
0
by: gcwg | last post by:
Hi all, I am attempting to use the LWP::UserAgent to request a Soap call, and in the response the request returns a TIFF image. When I write the contents out to a file(binary mode), the file also...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.