Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 4:34 PM
To: Boyd, Todd M.
Cc: php-general@lists.php.net
Subject: Re: [PHP] Displaying files
On 14 Aug 2008, at 22:24, Boyd, Todd M. wrote:
-Original Message-
From: Stut [mailto:[EMAIL
Okay, I'm perplexed!
If I put the exact same value into a javascript function and open a window
the document comes up perfectly fine.
But, when trying to readfile() copy() or fopen() in PHP I get the failed to
open stream: error.
Any idea why the exact same link would open fine using a HTML
On 15 Aug 2008, at 14:07, Dan Shirah wrote:
Okay, I'm perplexed!
If I put the exact same value into a javascript function and open a
window
the document comes up perfectly fine.
But, when trying to readfile() copy() or fopen() in PHP I get the
failed to
open stream: error.
Any idea why
On 8/15/08, Dan Shirah [EMAIL PROTECTED] wrote:
Okay, I'm perplexed!
If I put the exact same value into a javascript function and open a window
the document comes up perfectly fine.
But, when trying to readfile() copy() or fopen() in PHP I get the failed
to
open stream: error.
Any idea
:
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 4:34 PM
To: Boyd, Todd M.
Cc: php-general@lists.php.net
Subject: Re: [PHP] Displaying files
On 14 Aug 2008, at 22:24, Boyd, Todd M. wrote:
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent
Because as I mentioned before PHP runs as a different user to your
browser.
-Stut
Stut,
Are you referring to this?
If you're using IIS then it's the IUSR_machine user which doesn't have
access to the network by default
The IUSR_SERVERNAME account is what it should be connecting as
On 8/15/08, Dan Shirah [EMAIL PROTECTED] wrote:
Thiago,
HTML WORKS
a href=\\server\folder\file.xls target=_blankOpen/a
Javascript WORKS
function openWin(folder,file) {
var LeftPosition = (this.screen.width) / 2;
var TopPosition = (this.screen.height) - this.screen.height;
var
On 15 Aug 2008, at 14:26, Dan Shirah wrote:
Because as I mentioned before PHP runs as a different user to your
browser.
-Stut
Stut,
Are you referring to this?
If you're using IIS then it's the IUSR_machine user which doesn't
have access to the network by default
The IUSR_SERVERNAME
Wow, I think it finally clicked.
Sorry that took so long.
The whole point behind using PHP was to try and copy or call the file from
the server side so the user does not see the path to the document. Using
HTML and Javascript it is extrememly easy to just view source and see the
path. Whereas
On 8/15/08, Dan Shirah [EMAIL PROTECTED] wrote:
Wow, I think it finally clicked.
Sorry that took so long.
That's fine, sorry if I sounded rude or something. I didn't mean it.
The whole point behind using PHP was to try and copy or call the file from
the server side so the user does not
On Aug 15, 2008, at 9:57 AM, Dan Shirah wrote:
Wow, I think it finally clicked.
Sorry that took so long.
The whole point behind using PHP was to try and copy or call the
file from
the server side so the user does not see the path to the document.
Using
HTML and Javascript it is
What about using some type of a dispatch script? Locate all the files
outside of the doc root and then just call: viewdocument.php?ID=12345678 ?
Although now that I've typed that I realize that you would still be running
the same issue.. Unless you used javascript in your PHP to call the file
On 15 Aug 2008, at 15:17, Dan Shirah wrote:
What about using some type of a dispatch script? Locate all the
files outside of the doc root and then just call: viewdocument.php?
ID=12345678 ? Although now that I've typed that I realize that you
would still be running the same issue.. Unless
Your best bet would be to run a periodic sync to copy the files across
from the other server but it would have to run outside the IIS process.
There are plenty of solutions around for doing this and they have nothing to
do with PHP. You can then refer to the local copy of the file from PHP
On 15 Aug 2008, at 15:41, Dan Shirah wrote:
Your best bet would be to run a periodic sync to copy the files
across from the other server but it would have to run outside the
IIS process. There are plenty of solutions around for doing this and
they have nothing to do with PHP. You can then
A scheduled task is messy. IIWY I'd use FTP to pull the file over, but
that's still pretty messy.
If this is an Intranet then the risks involved in giving that user access
to the network is minimal and probably would be the best solution.
Alternatively you could set up an HTTP server on the
On Aug 14, 2008, at 3:29 PM, Dan Shirah wrote:
You need to know the mime type for the file you're serving. Call
header('Content-Type: x/y'); where x/y is the mime type. Then call
readfile('/path/to/file/on/server'); to output the file to the
browser.
-Stut
Stut, trying that method
I think this should be a simple question and answer, but after looking
through the manual and goggling I have yet to find an answer.
Question: Using PHP, how would I go about opening a file in a window, table
or div?
Example: I have a file called 123.xls. When a condition is met, I want PHP
to
Dan Shirah wrote:
I think this should be a simple question and answer, but after looking
through the manual and goggling I have yet to find an answer.
Question: Using PHP, how would I go about opening a file in a window, table
or div?
Example: I have a file called 123.xls. When a condition is
Who needs PHP... :)
The following will open a new browser window and load the href in it.
a href=http://examples.com/123.xls; target=_blankOpen It!!!/a
If that isn't what you are looking for, please give a little more details.
You're killin' me, Jim! :)
I need to open the file from the
On 14 Aug 2008, at 21:06, Dan Shirah wrote:
Who needs PHP... :)
The following will open a new browser window and load the href in
it.
a href=http://examples.com/123.xls; target=_blankOpen It!!!/a
If that isn't what you are looking for, please give a little more
details.
You're
You need to know the mime type for the file you're serving. Call
header('Content-Type: x/y'); where x/y is the mime type. Then call
readfile('/path/to/file/on/server'); to output the file to the browser.
-Stut
Stut, trying that method gives me the following: PHP Warning: readfile(
On 14 Aug 2008, at 21:29, Dan Shirah wrote:
You need to know the mime type for the file you're serving. Call
header('Content-Type: x/y'); where x/y is the mime type. Then call
readfile('/path/to/file/on/server'); to output the file to the
browser.
-Stut
Stut, trying that method gives me
That simply means it can't open the file. Make sure the machine this is
running on has everything it needs to access that UNC filename.
-Stut
Stut,
If I copy the link from the error message and paste it into a browser
running from my PHP server, the file comes up just fine.
Should I try
On 14 Aug 2008, at 21:57, Dan Shirah wrote:
That simply means it can't open the file. Make sure the machine this
is running on has everything it needs to access that UNC filename.
-Stut
Stut,
If I copy the link from the error message and paste it into a
browser running from my PHP
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 4:21 PM
To: Dan Shirah
Cc: PHP-General List
Subject: Re: [PHP] Displaying files
On 14 Aug 2008, at 21:57, Dan Shirah wrote:
That simply means it can't open the file. Make sure the machine
On 14 Aug 2008, at 22:24, Boyd, Todd M. wrote:
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 4:21 PM
To: Dan Shirah
Cc: PHP-General List
Subject: Re: [PHP] Displaying files
On 14 Aug 2008, at 21:57, Dan Shirah wrote:
That simply means it can't
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2008 4:34 PM
To: Boyd, Todd M.
Cc: php-general@lists.php.net
Subject: Re: [PHP] Displaying files
On 14 Aug 2008, at 22:24, Boyd, Todd M. wrote:
-Original Message-
From: Stut [mailto
Hi. I'm storing an uploaded file into a MySQL database. I want the
file to then be downloaded and viewed. Uploading looks like:
snippet
if (is_uploaded_file($file) $filename) {
$handle = fopen ($file, 'r');
$resume[data] = base64_encode (fread ($handle, filesize ($file)));
On 3/28/07, Philip Thompson [EMAIL PROTECTED] wrote:
Hi. I'm storing an uploaded file into a MySQL database. I want the
file to then be downloaded and viewed. Uploading looks like:
snippet
if (is_uploaded_file($file) $filename) {
$handle = fopen ($file, 'r');
$resume[data] = base64_encode
Philip Thompson wrote:
Hi. I'm storing an uploaded file into a MySQL database. I want the file
to then be downloaded and viewed. Uploading looks like:
Assuming you actually have a good reason *why* you are storing uploaded
files in your database, how has the table been set-up? What is the
On Mar 28, 2007, at 12:59 PM, Tijnema ! wrote:
On 3/28/07, Philip Thompson [EMAIL PROTECTED] wrote:
Hi. I'm storing an uploaded file into a MySQL database. I want the
file to then be downloaded and viewed. Uploading looks like:
snippet
if (is_uploaded_file($file) $filename) {
$handle =
On Mar 28, 2007, at 1:36 PM, Richard Davey wrote:
Philip Thompson wrote:
Hi. I'm storing an uploaded file into a MySQL database. I want the
file to then be downloaded and viewed. Uploading looks like:
Assuming you actually have a good reason *why* you are storing
uploaded files in your
33 matches
Mail list logo