Hello James and others,

The files I want from the IRS are self extacting files (exe),  I want
to be able to download them from the IRS site and upload them to the
webhosting site of my website.

Can you tell me more about zlib?  Also what would be the best fuction
to retreive these files from the IRS site?

Sincerly,
Christopher & Missy

On 3/28/06, James Keeline <[EMAIL PROTECTED]> wrote:
> > 1st.  Does any one know of a script or the areas I should look at for
> > grabbing files off a site and having them be on a server?  For ex:
> > Going to the IRS website and downloading a file to webhosting server!
>
> It depends entirely on the nature of the file and what you want to do with 
> it.  For example the
> PHP function file() (http://php.net/file)will often be able to read an 
> external publicly-readable
> link into a PHP array where each element of the array is a line of the array:
>
> $array = file("http://someurl";);
> $html  = join("", $array);
>
> The second line above puts the multiple elements into a single large string 
> variable.  Of course,
> you can do it in one step with 
> file_get_contents()(http://us3.php.net/file_get_contents).
>
> $html  = file_get_contents("http://someurl";);
>
> Your PHP must be configured to allow fopen wrappers for this to work.  Once 
> the content is in a
> string, you can manipulate it, put it in a database, put it in a text file, 
> etc.
>
>
> If the file is a binary, such as an Adobe Acrobat PDF (which might be common 
> on the IRS site) then
> you would want another method to save the file or present it to the end user 
> as if it were an
> attachment to make sure the binary content is not disturbed.
>
>
> Some of these tasks are best handled with the Bash shell on Linux using 
> commands like wget.  You
> can use a PHP function like exec() to trigger this.
>
> > 2nd.  does any one know how or if it can be done unzipping a exe zip
> > file with OUT running the exe as my webhosting service does not allow
> > this on the server with out me having to downloading and then
> > uploading the file after unzipping it?
>
> PHP has a zlib module which may allow this.  However, once again, if you are 
> on Linux, there are
> probably unzip commands to process .zip files and these can be triggered with 
> exec().
>
> Any time you have to use exec() you need to be very careful about the 
> validation of inputs and
> other security features of the web application to prevent outsiders from 
> being able to execute
> arbitrary Linux commands as the webserver user.
>
> James


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to