php-windows Digest 27 Aug 2009 04:24:19 -0000 Issue 3680

Topics (messages 29553 through 29557):

PHP form with upload file
        29553 by: Christian

Re: Getting the size of a file on a windows share [solved]
        29554 by: Frank Heyne

Re: php_enchant not loadable
        29555 by: Niel Archer

Re: php with iis
        29556 by: Ruslan Yakushev
        29557 by: Andi Gutmans

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I am running some PHP pages on IIS 6.0.  I have created a form that allows 
the user to fill in some data and attach a file such as a pdf.  When the 
user presses the submit button, the information the user filled in on the 
form is emailed me with the attachment.  All the information comes through 
just fine, however the attachment has an error:

Error message as follows: Acrobat could not open 'test.pdf' because it is 
either not a supported file type or because the file has been damaged (for 
example, it was sent as an email attachment and wasn't correctly decoded).

Here is the code I am using:

//Attachment Start
$fileatt      = $_FILES['fileatt']['tmp_name'];
$fileatt_type = "application/octet-stream"; // File Type
$fileatt_name = $_FILES['fileatt']['name'];

$headers = "From: ".$from;

$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);

$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";

$message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";

$data = chunk_split(base64_encode($data));

$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";


//Attachment End


thanks!

Christian 



--- End Message ---
--- Begin Message ---
The cause of the error was that the account the web server was running did not 
have access rights to the share :-(
Now all works fine.

Frank

On 25 Aug 2009 at 20:33, [email protected] wrote:

> Hi,
> 
> I need to read the file size of a file which is on a windows server, the file
> name looks like
>       \\server\share\path\file.ext
> 
> I already tried filesize() and fopen() followed by stream_get_meta_data(), but
> both methods do not work.
> 
> Any ideas how this simple task can be solved?
> 
> Thanks
> 
> Frank
> 



--- End Message ---
--- Begin Message ---
> Niel Archer wrote:
> >> Now that VC9 is the official MS compiler version, you still have TS vs
> >> NTS. You also need HEAD/PHP53/PHP52. So for the current 227 extensions
> >> in pecl, that results in a 1,362 builds. Now, if other compilers ARE
> >> needed (older Apache must have VC6), then that double to 2,724. Oh. I
> >> forgot x64, so 5,448 builds.
> > 
> > What do you mean "older Apache must have VC6"?  When did they change
> > that, and where is the info to be found?
> > I've been waiting for an official notice from Apache that they have
> > changed the version, so that I can put PHP 5.3 on my dev box.  As it is,
> > I see no mention on the site to say what the binaries are built with,
> > only that VC6 or later is required to compile yourself.
> 
> Nothing has changed, only how the windows builds of PHP are now
> 'managed' ... http://windows.php.net/download/ left hand column.
> 
> Anything that is included now in a PHP windows build has to have been
> built with the same version of VC, so many third party extensions are no
> longer available to windows users. This purely relates to php, and while
> the basic reason behind it does have a little sense, nothing has changed
> between PHP5.2 and PHP5.3 that would actually prevent properly
> configured import libraries using dissimilar versions of VC from being
> used - it is only the php windows build team that have decided that this
> is not allowed, and that all new windows builds require everything that
> php links to is build using VC9.


Yeah, I knew all that from following win-internals, and it's why I've
been waiting for an announcement from Apache.
 The OP implies that newer versions of Apache use VC9 (well, that they
do not need VC6).

> Third party builds of both Apache and PHP are available for x64 versions
> of windows for example and these do not follow the same over zealous
> restrictions ....

I'm also aware of these.  As much as I would like a 64 bit version of
Apache and PHP 5.3 on my Win2K3 server, I will have to live with the 32
bit versions until 64 bit versions are officially available.  I have to
be conservative for my servers and use official builds as I do not have
the time, or know how, to do it myself.

> -- 
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Niel Archer



--- End Message ---
--- Begin Message ---
For instructions on how to setup PHP and FastCGI on IIS6, refer to this article:

http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/

-----Original Message-----
From: Richard Quadling [mailto:[email protected]]
Sent: Tuesday, August 25, 2009 12:31 PM
To: John L
Cc: [email protected]
Subject: Re: [PHP-WIN] php with iis

2009/8/25 John L <[email protected]>:
> Hi,
>
> I'm very new to php sadly and having trouble installing php on my computer.
>
> I had asp.net installed previously and currently trying to make php work
> with iis. I followed the directions for the most part but "test" stage for
> test.wsf returns an error and trying to open the install/index.php page just
> prompts me to open it or save it. opening it does nothing as it seems to be
> associated with a program called CLI.
>
> If there's anything i missed during the installation or any help will be
> appreciated. thanks.
>
> John L.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Depending upon your version of IIS,
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
and 
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
may be relevant.

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
You can also get the following free, all-in-one package which will get a solid 
PHP stack w/ great performance configured on II6 - 
http://www.zend.com/en/products/server-ce/

Andi

> -----Original Message-----
> From: Ruslan Yakushev [mailto:[email protected]]
> Sent: Wednesday, August 26, 2009 2:22 PM
> To: '[email protected]'; 'John L'
> Cc: '[email protected]'
> Subject: RE: [PHP-WIN] php with iis
> 
> For instructions on how to setup PHP and FastCGI on IIS6, refer to this
> article:
> 
> http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-
> iis-60/
> 
> -----Original Message-----
> From: Richard Quadling [mailto:[email protected]]
> Sent: Tuesday, August 25, 2009 12:31 PM
> To: John L
> Cc: [email protected]
> Subject: Re: [PHP-WIN] php with iis
> 
> 2009/8/25 John L <[email protected]>:
> > Hi,
> >
> > I'm very new to php sadly and having trouble installing php on my computer.
> >
> > I had asp.net installed previously and currently trying to make php work
> > with iis. I followed the directions for the most part but "test" stage for
> > test.wsf returns an error and trying to open the install/index.php page just
> > prompts me to open it or save it. opening it does nothing as it seems to be
> > associated with a program called CLI.
> >
> > If there's anything i missed during the installation or any help will be
> > appreciated. thanks.
> >
> > John L.
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> Depending upon your version of IIS,
> http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-
> iis-70/
> and http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-
> on-iis-70/
> may be relevant.
> 
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---

Reply via email to