Problem using mime_content_type() 
Author Message
 Problem using mime_content_type()

Hi
I have problem with mime_content_type()  function.When I call it I get this
error message
Fatal error: Call to undefined function: mime_content_type() in C:\Program
Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

The script is the following:

echo mime_content_type($lob_upload);

$lob_upload is a file which I want to upload on my server

I guess it can't find it, so what do I need  to run this function successful
?



Fri, 20 May 2005 21:54:38 GMT  
 Problem using mime_content_type()

Quote:

> Hi
> I have problem with mime_content_type()  function.When I call it I get this
> error message
> Fatal error: Call to undefined function: mime_content_type() in C:\Program
> Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

> The script is the following:

> echo mime_content_type($lob_upload);

> $lob_upload is a file which I want to upload on my server

> I guess it can't find it, so what do I need  to run this function successful

as written on the manual page this function only exists in the cvs
version of php4, which mean you need to download the cvs version and
compile it yourself.. that is not a posibility if you are not hosting
your site on your own server, so if I were you I would wait to use the
function untill the function gets in the next php4 release.

--
Henrik Hansen



Fri, 20 May 2005 22:02:14 GMT  
 Problem using mime_content_type()
So is there any other way to get mime type of the file which I want to
upload on my server ?


Quote:

> > Hi
> > I have problem with mime_content_type()  function.When I call it I get
this
> > error message
> > Fatal error: Call to undefined function: mime_content_type() in
C:\Program
> > Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

> > The script is the following:

> > echo mime_content_type($lob_upload);

> > $lob_upload is a file which I want to upload on my server

> > I guess it can't find it, so what do I need  to run this function
successful

> as written on the manual page this function only exists in the cvs
> version of php4, which mean you need to download the cvs version and
> compile it yourself.. that is not a posibility if you are not hosting
> your site on your own server, so if I were you I would wait to use the
> function untill the function gets in the next php4 release.

> --
> Henrik Hansen



Fri, 20 May 2005 22:04:59 GMT  
 Problem using mime_content_type()
Poe said:

Quote:
>Hi
>I have problem with mime_content_type()  function.When I call it I get this
>error message
>Fatal error: Call to undefined function: mime_content_type() in C:\Program
>Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

mime_content_type is only in the CVS version of PHP.  Did you do a checkout
from CVS and then compile?  If not, do that.  If so, did you get any
messages regarding mime_content_type as you were compiling?

--
Joseph Birr-Pixton



Fri, 20 May 2005 22:27:24 GMT  
 Problem using mime_content_type()
Poe said:

Quote:
>So is there any other way to get mime type of the file which I want to
>upload on my server ?

Check out `file`.

FILE(1)                                                   FILE(1)

NAME
       file - determine file type

SYNOPSIS
       file  [  -bcnsvzL ] [ -f namefile ] [ -m magicfiles ] file
       ...

DESCRIPTION
       This manual page documents version 3.27 of the  file  com-
       mand.   File tests each argument in an attempt to classify
       it.  There are three sets  of  tests,  performed  in  this
       order:  filesystem tests, magic number tests, and language
       tests.  The first test that succeeds causes the file  type
       to be printed.

       The  type  printed  will  usually contain one of the words
       text (the file contains only ASCII characters and is prob-
       ably  safe  to read on an ASCII terminal), executable (the
       file contains the result of compiling a program in a  form
       understandable  to  some  UNIX kernel or another), or data
       meaning anything else (data is usually  `binary'  or  non-
       printable).   Exceptions are well-known file formats (core
       files, tar archives) that  are  known  to  contain  binary
       data.   When  modifying  the  file /usr/share/magic or the
       program itself, preserve these keywords .   People  depend
       on knowing that all the readable files in a directory have
       the word ``text'' printed.  Don't do  as  Berkeley  did  -
       change ``shell commands text'' to ``shell script''.

       The  filesystem  tests  are  based on examining the return
       from a stat(2) system call.  The program checks to see  if
       the  file  is empty, or if it's some sort of special file.
       Any known file types appropriate to  the  system  you  are
       running  on  (sockets,  symbolic  links,  or  named  pipes
       (FIFOs) on those systems that implement them) are intuited
       if  they are defined in the system header file sys/stat.h.
etc.

--
Joseph Birr-Pixton



Fri, 20 May 2005 22:38:29 GMT  
 Problem using mime_content_type()

Quote:

> I have problem with mime_content_type()  function.When I call it I get
this
> error message
> Fatal error: Call to undefined function: mime_content_type() in C:\Program
> Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

> The script is the following:

> echo mime_content_type($lob_upload);

> $lob_upload is a file which I want to upload on my server

> I guess it can't find it, so what do I need  to run this function
successful
> ?

If you are uploading using a form then
the MIME type is made available.

Read:
http://www.php.net/manual/en/features.file-upload.php

$_FILES['form_file_name']['type'];

regards,
reggie.



Sat, 21 May 2005 06:51:35 GMT  
 Problem using mime_content_type()
Thanks for help it solved my problem ;)


Quote:

> > I have problem with mime_content_type()  function.When I call it I get
> this
> > error message
> > Fatal error: Call to undefined function: mime_content_type() in
C:\Program
> > Files\Apache Group\Apache2\htdocs\sprawdz.php on line 6 occurs

> > The script is the following:

> > echo mime_content_type($lob_upload);

> > $lob_upload is a file which I want to upload on my server

> > I guess it can't find it, so what do I need  to run this function
> successful
> > ?

> If you are uploading using a form then
> the MIME type is made available.

> Read:
> http://www.php.net/manual/en/features.file-upload.php

> $_FILES['form_file_name']['type'];

> regards,
> reggie.



Sat, 21 May 2005 16:40:16 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. problem using using list with function

2. Problems using Armadillo with deployed app

3. debugger problem using ##(...)

4. Calling DLL using []NA problem

5. Problem with framing layout on a system using large fonts

6. Problem using the IEWTPORT utility

7. Help: Problem with IBM Smalltalk ObjectLoader using runtime image

8. J3 problem using wd 'wait'

9. Problem using APLASCII

10. awk lookup problem using getline

11. Problems getting username used to mount network volumes.

12. multiple regression using AWK Problem

 

 
Powered by phpBB® Forum Software