Page 1 of 1

file type problems

Posted: Mon Oct 20, 2008 7:20 am
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

Re: file type problems

Posted: Mon Oct 20, 2008 7:40 am
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

Re: file type problems

Posted: Mon Oct 20, 2008 9:07 am
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?

Re: file type problems

Posted: Mon Oct 20, 2008 9:54 am
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.

Re: file type problems

Posted: Mon Oct 20, 2008 9:56 am
by panic!
use

Code: Select all

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