php-windows Digest 5 Sep 2007 15:04:22 -0000 Issue 3322

Topics (messages 28426 through 28431):

Re: open/download file not under www-root
        28426 by: Gustav Wiberg
        28427 by: Gustav Wiberg

Browse/file-button - default path?
        28428 by: Gustav Wiberg
        28429 by: John Mertic
        28430 by: Gustav Wiberg

path + filename
        28431 by: Gustav Wiberg

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 ---
Hi!

Ok, I will try this... :-)

Best regards
/Gustav Wiberg
 

-----Original Message-----
From: Armando [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 05, 2007 4:10 AM
To: Gustav Wiberg
Cc: 'Stut'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Re: [PHP-WIN] open/download file not under www-root

As long as the user that Apache is running under has NTFS read 
permissions to the target folder, then you should have no problems. A 
quick and dirty force method that I use would be something like this:

$file = "x:\\path\\to\\the\\file.pdf";
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);

Note the double backslashes! Cheers.

Armando

Gustav Wiberg wrote:
> Hi Stut!
> 
> Exactly what does that mean? Do you have any references? Please send :-)
> 
> Best regards
> /Gustav Wiberg
>  
> 
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 04, 2007 2:02 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] open/download file not under www-root
> 
> [EMAIL PROTECTED] wrote:
>>  I thought accessing files/directories above the www-root via the web was 
>> impossible???
> 
> Directly yes, but you can proxy it through a server-side script.
> 
> -Stut
> 

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


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 22:36
 

--- End Message ---
--- Begin Message ---
Hi there!

Thank you! It worked so fine.. Cool! :-)

Best regards
/Gustav Wiberg
 

-----Original Message-----
From: Armando [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 05, 2007 4:10 AM
To: Gustav Wiberg
Cc: 'Stut'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Re: [PHP-WIN] open/download file not under www-root

As long as the user that Apache is running under has NTFS read 
permissions to the target folder, then you should have no problems. A 
quick and dirty force method that I use would be something like this:

$file = "x:\\path\\to\\the\\file.pdf";
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);

Note the double backslashes! Cheers.

Armando

Gustav Wiberg wrote:
> Hi Stut!
> 
> Exactly what does that mean? Do you have any references? Please send :-)
> 
> Best regards
> /Gustav Wiberg
>  
> 
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 04, 2007 2:02 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] open/download file not under www-root
> 
> [EMAIL PROTECTED] wrote:
>>  I thought accessing files/directories above the www-root via the web was 
>> impossible???
> 
> Directly yes, but you can proxy it through a server-side script.
> 
> -Stut
> 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 22:36
 

--- End Message ---
--- Begin Message ---
Hi!
 
When using a browse- (FILE-button) in a form, then I want to use default path 
like c:\test. Is this possible to achieve this through PHP???
 
I want to come to c;\test when I push the file-button (no matter what the path 
was before)
 
 
Best regards
/Gustav Wiberg

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 22:36
 

--- End Message ---
--- Begin Message ---
Are you saying that you want the default directory on the users
computer to select a file from to be "c:\test"? If so that cannot be
done be due to security and cross-platform compatibly issues.

On 9/5/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> Hi!
>
> When using a browse- (FILE-button) in a form, then I want to use default path 
> like c:\test. Is this possible to achieve this through PHP???
>
> I want to come to c;\test when I push the file-button (no matter what the 
> path was before)
>
>
> Best regards
> /Gustav Wiberg
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 
> 22:36
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
-- 
John Mertic                                        "Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED]                              understand it better,
but the frog dies in the
                                                          process."

                      -Mark Twain

--- End Message ---
--- Begin Message ---
Hi!

Ok, thank you! That was all I want to know... :-)

Best regards
/Gustav Wiberg
 

-----Original Message-----
From: John Mertic [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 05, 2007 2:46 PM
To: Gustav Wiberg
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Browse/file-button - default path?

Are you saying that you want the default directory on the users
computer to select a file from to be "c:\test"? If so that cannot be
done be due to security and cross-platform compatibly issues.

On 9/5/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> Hi!
>
> When using a browse- (FILE-button) in a form, then I want to use default path 
> like c:\test. Is this possible to achieve this through PHP???
>
> I want to come to c;\test when I push the file-button (no matter what the 
> path was before)
>
>
> Best regards
> /Gustav Wiberg
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 
> 22:36
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
-- 
John Mertic                                        "Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED]                              understand it better,
but the frog dies in the
                                                          process."

                      -Mark Twain

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 22:36
 

--- End Message ---
--- Begin Message ---
Hi!
 
 
>From a browse/file-button in a html-form, how Do I retrieve the actual name 
>including the path to it???
 
I don't want just filename.doc. 


This would returnthe filename only...
$doc = $_FILES['frmNewsDocument']['name'];


I want to retrieve c:\program\filename.doc

 
Best regards
/Gustav Wiberg

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 2007-09-04 22:36
 

--- End Message ---

Reply via email to