473,406 Members | 2,208 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,406 software developers and data experts.

Weird problem with download

I am experiencing a weird problem with a popular PHP web application
(Moodle).

The thing uses a custom function to allow you to download/open a file.
That function just send a series of header fields (depending on the file
extension), then outputs the file to the client browser. The result that
all poeple seems to get is that the file opens in the proper application
(i.e. .doc files in the wordprocessor, .ppt in powerpoint etc).

When I try to open a file I also get the proper application to open.
However, it is unable to read the file.
It I chose to download the file and look with an hex editor, I find that
two bytes (0D 0A)are added at the beginning of the file, then all the
file content is shifted by two bytes, and the last two bytes are missing
(so that the size remains the same as the original file).

If I make a copy the file output on the server while it is sent to the
client, the one copied on the server is correct, while the one arriving
to the clent is broken as described. So the bug is somewhere after the
content is sent ...
I suspect one of the headers, but since I seem to be the only one with
this problem it could be some PHP setting. What can cause such a behaviour?
I am using php 4.3.10 under xp and os/2
thanks
piesse
Dec 27 '05 #1
0 1149

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

Similar topics

5
by: news | last post by:
I've a site: http://gto.ie-studios.net/products.php that looks perfectly fine in Windows whether with IE or Firefox 1.0. But when viewed in the Linux version of Firefox 1.0, images get misaligned...
0
by: TJ | last post by:
Hi, I've written code web-based uploading and downloading. Here is some code for it. For saving file into MS-SQL database, SaveFileIntoDB(HttpPostedFile file) { int fileLength =...
5
by: marcmc | last post by:
Is it in any way possible to have a sProc called and executed within SQLServer return its return value to an open .Net Vb application? As a programmer I beleive this can be done and if I wreck my...
2
by: | last post by:
I need to download an rss feed on a regular basis that is embedded only in javascript (external website) and store it on my webserver's hard drive someplace. The code goes like this: <script...
2
by: brian | last post by:
I have a aspx page that creates a binary file and response.binarywrites it to the browser. To force the file to be saved or opened I use the "Content-Disposition" header. All works fine in...
4
by: PiotrKolodziej | last post by:
hi I have a thread that downloades a file. Problem is : Not all files are beeing downloaded. I observed that only the small files are beeing downloaded correctly. I also cant download two files...
0
by: Petri | last post by:
Hi, I'm porting my App from .NET 1.1 to .NET 2.0, and I encountered a really weird problem. I hope some of you could help... I have a function that downloads an XML file from a web server to...
0
by: probir.chatterjee | last post by:
Hi, Has anyone encountered similar problem before. I have an webpage in a webapplication that usesDataSet .WriteXml method to write a Log file. The page is meant to export out files in excel and...
0
by: rugman | last post by:
Hi. Let me immediately declare - I'm a designer/owner of a website written in jsp pages running under Apache Tomcat 5.5.25. I make simple changes to code but don't understand much about...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.