file type problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lettie_dude
Forum Commoner
Posts: 65
Joined: Thu Dec 07, 2006 10:10 am

file type problems

Post by lettie_dude »

Hi

anyone come across this before?

Have created a file upload system for a client. Files are upload by clients and are downloaded via the cms. Problem I have is with the file types.

A client has uploaded a file .rng which I assume is a file produced by some specific software. (not a nokia ringtone)

The file has uploaded correctly to the correct directory as I can see it on the server.

The problem is when browsing to this particular file the browser just returns a page not found error. (this applies to ie, firefox and opera) although the file is there.

I wondered if this was a problem with the move_uploaded_file function or some other problem with php and the file type.

The only other thing that I think may be effecting it is that the server does not recognise the file and this may be causing it to return a page not found as it has nothing to open it with!

Any ideas appreciated.

Cheers
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: file type problems

Post by jaoudestudios »

You will not be able to render the file as a page, but you should be able to force a download of the file
lettie_dude
Forum Commoner
Posts: 65
Joined: Thu Dec 07, 2006 10:10 am

Re: file type problems

Post by lettie_dude »

Cheers jaoudestudios

Was looking at doing this anyway. Took a bit of re-coding but it worked. Just one question why do modern browser not give a choice now and try to render all files as pages even if it is something it does not recognise? Is it a security thing?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: file type problems

Post by aceconcepts »

By defualt browsers will prompt you to "open" or "save" a file. On the other hand it depends on the browser settings I would imagine.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: file type problems

Post by panic! »

use

Code: Select all

 
header('content-type: application/rng');
 
Post Reply