Re: [PHP] Link to download files on another part of system

2007-03-30 Thread Jochem Maas
Rahul Sitaram Johari wrote:
 Ave,
 
 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.
 
 Code:
 
 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
 e($value)./a/fontBR;
 }
 ?

why are you using exec() to run 'find'??? what is wrong with glob()?

 
 The files I¹m linking to, in order to let the User download them, reside on
 a mounted share on my system. They are on in the Apache Web Server htdocs
 folder where my website resides. How do I make these files available to
 download if they are not in my webserver folder?

via a php script that outputs the relevant headers and uses readfile() on the
relevant file.

 
 Thanks!
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 

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



Re: [PHP] Link to download files on another part of system

2007-03-30 Thread Tijnema !

On 3/30/07, Jochem Maas [EMAIL PROTECTED] wrote:

Rahul Sitaram Johari wrote:
 Ave,

 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.

 Code:

 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
 e($value)./a/fontBR;
 }
 ?

why are you using exec() to run 'find'??? what is wrong with glob()?


He asked a way to do what he wanted in the thread Show files using
Wildcards, There somebody came up with the idea using find.

Tijnema

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



Re: [PHP] Link to download files on another part of system

2007-03-30 Thread Rahul Sitaram Johari

Yes, and while I dig up on glob(), to be quite honest, the exec is working
very effectively and fast for my searches  download application - so can't
complain about it one bit.

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



On 3/30/07 9:27 AM, Tijnema ! [EMAIL PROTECTED] wrote:

 On 3/30/07, Jochem Maas [EMAIL PROTECTED] wrote:
 Rahul Sitaram Johari wrote:
 Ave,
 
 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.
 
 Code:
 
 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
 e($value)./a/fontBR;
 }
 ?
 
 why are you using exec() to run 'find'??? what is wrong with glob()?
 
 He asked a way to do what he wanted in the thread Show files using
 Wildcards, There somebody came up with the idea using find.
 
 Tijnema
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP] Link to download files on another part of system

2007-03-29 Thread Rahul Sitaram Johari
Ave,

This is actually a continuation of my previous ³Show files using Wildcards²
thread, but a different problem.

Code:

?php
exec(find /Users/rjohari/Documents/XFER/espi -type f -name
.$row['PHONE'].*.vox, $files);
foreach ($files as $value) {
echo font face=arial size=1a
href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
e($value)./a/fontBR;
}
?

The files I¹m linking to, in order to let the User download them, reside on
a mounted share on my system. They are on in the Apache Web Server htdocs
folder where my website resides. How do I make these files available to
download if they are not in my webserver folder?

Thanks!

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Rahul Sitaram Johari

Correction, please disregard previous post:

Ave,

This is actually a continuation of my previous ³Show files using Wildcards²
thread, but a different problem.

Code:

?php
exec(find /Users/rjohari/Documents/XFER/espi -type f -name
.$row['PHONE'].*.vox, $files);
foreach ($files as $value) {
echo font face=arial size=1a
href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
e($value)./a/fontBR;
}
?

The files I¹m linking to, in order to let the User download them, reside on
a mounted share on my system. They are NOT in the Apache Web Server htdocs
folder where my website resides. How do I make these files available to
download if they are not in my webserver folder?

Thanks!

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Tijnema !

On 3/29/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:

Ave,

This is actually a continuation of my previous ³Show files using Wildcards²
thread, but a different problem.

Code:

   ?php
   exec(find /Users/rjohari/Documents/XFER/espi -type f -name
.$row['PHONE'].*.vox, $files);
   foreach ($files as $value) {
   echo font face=arial size=1a
href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
e($value)./a/fontBR;
   }
   ?

The files I¹m linking to, in order to let the User download them, reside on
a mounted share on my system. They are on in the Apache Web Server htdocs
folder where my website resides. How do I make these files available to
download if they are not in my webserver folder?

Thanks!


A very simple way is to link the
Users/rjohari/Documents/XFER/osm/ESPI/ to some folder inside your www
directory :)

Didn't test it, but it should work though. Else you need to create
some download script. (header, file_get_contents,echo)

Tijnema


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²




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



Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Zoltán Németh
2007. 03. 29, csütörtök keltezéssel 22.46-kor Tijnema ! ezt írta:
 On 3/29/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
  Ave,
 
  This is actually a continuation of my previous ³Show files using Wildcards²
  thread, but a different problem.
 
  Code:
 
 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
  .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
  href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
  e($value)./a/fontBR;
 }
 ?
 
  The files I¹m linking to, in order to let the User download them, reside on
  a mounted share on my system. They are on in the Apache Web Server htdocs
  folder where my website resides. How do I make these files available to
  download if they are not in my webserver folder?
 
  Thanks!
 
 A very simple way is to link the
 Users/rjohari/Documents/XFER/osm/ESPI/ to some folder inside your www
 directory :)

I think following symlinks can be switched off in apache configuration
by default (however I'm absolutely not sure about this...) - so use it
only if you can configure apache

greets
Zoltán Németh

 
 Didn't test it, but it should work though. Else you need to create
 some download script. (header, file_get_contents,echo)
 
 Tijnema
 
  ~~~
  Rahul Sitaram Johari
  CEO, Twenty Four Seventy Nine Inc.
 
  W: http://www.rahulsjohari.com
  E: [EMAIL PROTECTED]
 
  ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 

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



Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Rahul Sitaram Johari
Ave,

I¹m going to try creating the sharepoint within my webserver, as suggested
by you and tijnema. I think that¹s probably the easiest and quickest
solution to this. I¹ll report back!

Thanks!


On 3/29/07 4:48 PM, Daniel Brown [EMAIL PROTECTED] wrote:

 
 Rahul,
 
 Your best bet in this case, with the most minimal coding, would be to
 either symlink the individual files into a web-accessible directory, or
 symlink the directory containing those files into a web-accessible location.
 However, this part would be up to you, determinable by your current system
 configuration and potential security risks ( e.g. - the directory is also the
 parent directory for information needing to remain secure, so we don't want to
 symlink the directory).
 
 Another option would be to read the file through a script and output it
 sending a MIME type prior to the data output, placing the name of the file on
 the server into the output bugger head so that the user would see it simply as
 a direct download.
 
 On 3/29/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 Ave,
 
 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.
 
 Code:
 
 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
 e($value)./a/fontBR;
 }
 ?
 
 The files I¹m linking to, in order to let the User download them, reside on
 a mounted share on my system. They are on in the Apache Web Server htdocs
 folder where my website resides. How do I make these files available to
 download if they are not in my webserver folder?
 
 Thanks!
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 
 
 




Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Roberto Mansfield
Only do this if all the files should be publicly accessible. Otherwise,
you'll need to create a php wrapper to do authorization before sending
the file.

-Roberto


Rahul Sitaram Johari wrote:
 Ave,
 
 I¹m going to try creating the sharepoint within my webserver, as suggested
 by you and tijnema. I think that¹s probably the easiest and quickest
 solution to this. I¹ll report back!
 
 Thanks!
 
 
 On 3/29/07 4:48 PM, Daniel Brown [EMAIL PROTECTED] wrote:
 
 Rahul,

 Your best bet in this case, with the most minimal coding, would be to
 either symlink the individual files into a web-accessible directory, or
 symlink the directory containing those files into a web-accessible location.
 However, this part would be up to you, determinable by your current system
 configuration and potential security risks ( e.g. - the directory is also the
 parent directory for information needing to remain secure, so we don't want 
 to
 symlink the directory).

 Another option would be to read the file through a script and output it
 sending a MIME type prior to the data output, placing the name of the file on
 the server into the output bugger head so that the user would see it simply 
 as
 a direct download.

 On 3/29/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 Ave,

 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.

 Code:

 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basenam
 e($value)./a/fontBR;
 }
 ?

 The files I¹m linking to, in order to let the User download them, reside on
 a mounted share on my system. They are on in the Apache Web Server htdocs
 folder where my website resides. How do I make these files available to
 download if they are not in my webserver folder?

 Thanks!

 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.

 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]

 ³I morti non sono piu soli ... The dead are no longer lonely²


 
 
 

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



Re: [PHP] Link to download files on another part of system - SOLVED!

2007-03-29 Thread Rahul Sitaram Johari
Ave,

I think I did it! I created a sharepoint within my web server (inside my
website) and mounted the share on that sharepoint. Once I did that, I
specified correct paths and my downloads are now working. I created a ³jump
menu² select list and this is what I¹ve come up with:

SCRIPT LANGUAGE=JavaScript
function openVox(form) {
var newIndex = form.voxSelect.selectedIndex;
if (newIndex == 0) {
//alert( Please select a file to download! );
} else { 
dlvox = form.voxSelect.options[newIndex].value;
window.location.assign(dlvox);
} 
} 
/SCRIPT 
FORM NAME=voxForm STYLE=margin: 0px; padding: 0px;
SELECT NAME=voxSelect  onChange=openVox(this.form)
OPTION... Choose Recording .../OPTION
?php
exec(find /Library/WebServer/Documents/website.com/folder/vox -type f
-name .$row['PHONE'].*.vox, $files);
foreach ($files as $value) {
echo OPTION 
VALUE='vox/.basename($value).'.basename($value)./option;
}
?
/SELECT
/FORM

Now it¹s able to pull up filenames associated with a record using it¹s phone
number and the wildcard method suggested previously, and a user can select
the file from a drop down and it comes up for Download. Perfect!

Thanks!!

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²


 Ave,
 
 I¹m going to try creating the sharepoint within my webserver, as suggested
 by you and tijnema. I think that¹s probably the easiest and quickest
 solution to this. I¹ll report back!
 
 Thanks!
 
 
 On 3/29/07 4:48 PM, Daniel Brown [EMAIL PROTECTED] wrote:
 
 Rahul,
 
 Your best bet in this case, with the most minimal coding, would be to
 either symlink the individual files into a web-accessible directory, or
 symlink the directory containing those files into a web-accessible location.
 However, this part would be up to you, determinable by your current system
 configuration and potential security risks ( e.g. - the directory is also
 the
 parent directory for information needing to remain secure, so we don't want
 to
 symlink the directory).
 
 Another option would be to read the file through a script and output it
 sending a MIME type prior to the data output, placing the name of the file
 on
 the server into the output bugger head so that the user would see it simply
 as
 a direct download.
 
 On 3/29/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote:
 Ave,
 
 This is actually a continuation of my previous ³Show files using Wildcards²
 thread, but a different problem.
 
 Code:
 
 ?php
 exec(find /Users/rjohari/Documents/XFER/espi -type f -name
 .$row['PHONE'].*.vox, $files);
 foreach ($files as $value) {
 echo font face=arial size=1a
 
href='/Users/rjohari/Documents/XFER/osm/ESPI/.basename($value).'.basena
m
 e($value)./a/fontBR;
 }
 ?
 
 The files I¹m linking to, in order to let the User download them, reside on
 a mounted share on my system. They are on in the Apache Web Server htdocs
 folder where my website resides. How do I make these files available to
 download if they are not in my webserver folder?
 
 Thanks!
 
 ~~~
 Rahul Sitaram Johari
 CEO, Twenty Four Seventy Nine Inc.
 
 W: http://www.rahulsjohari.com
 E: [EMAIL PROTECTED]
 
 ³I morti non sono piu soli ... The dead are no longer lonely²
 




Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Rahul Sitaram Johari
Ave,

You've actually raised pretty valid security issues.
The files in that particular mounted share can be publicly accessible so I'm
not worried about that. But I'll certainly validate phone number before
executing the find command.

Thanks!

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²


On 3/29/07 5:33 PM, Roberto Mansfield [EMAIL PROTECTED] wrote:

 Only do this if all the files should be publicly accessible. Otherwise,
 you'll need to create a php wrapper to do authorization before sending
 the file.
 
 -Roberto

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