Download a torrent with php - php

I want to download a torrent using php.
So the scenario is that the user uploads a torrent and the server downloads it.
Than the user can download the torrent using his browser.

Dont know if this is the right way for you but:
Install rtorrent (https://wiki.archlinux.org/index.php/RTorrent)
configure rtorrent to watch a direcory for new torrent-files (http://jkt.im/2011/09/28/automatic-torrent-management-with-rtorrent-and-some-helper-scripts/)
rtorrent will download the files and move it into a directory like "done"
php script checks the folder vor new content and convert / show the files online in webpage

All the functionality you need already exist with rTWi http://rtwi.jmk.hu/ and its also open source so all you need is little customization

Related

Dropbox api - Can you get a hook to a file in dropbox? - PHP

I am investigating dropbox possibilities for integration with another api.
Can you get a hook to a file in dropbox.. for example - a url to open up and resave the file with new content.
Can you also create files using the dropbox api if permission has previously been granted? Maybe .txt or .xls files etc.
I believe that dropbox uses a local folder to store files, then some sort of background daemon to monitor said folder for changes. If this is the case, you can simply make changes to files in that folder and the rest should be automatic.
Please correct me if I'm wrong.

PHP Download file from non-hosted directory

I've been able to upload a file through PHP to a non-hosted directory (directory is not on the website) with read/write permissions for the PHP file (www). How would I download the file from this directory? I've been able to list the contents of the directory, but clicking on the files (made the filenames links) does not work as the computer attempts to download the file from the path on the server. I'm new to PHP, so all help is appreciated. Thanks!
Edit: Before I get down votes for this being a broad question, I just want to know how to access the files in the non-hosted directory and pass them to the user. I already know how to download normal files hosted on the website. Thanks!
You can use a delegating PHP file for file access. I don't know anything about your structure, but if you can write it, you can (presumably) read it back with file_get_contents:
<?php
echo file_get_contents('/the/path/to/the/unhosted/directory/file.ext');
?>

Flash/PHP: Using the AS3 Jpeg Encoder

I am a beginner at both Actionscript3 and PHP, and I'm trying to get Henry Jone's movie clip to jpeg code to work for me, as seen here:
http://henryjones.us/articles/using-the-as3-jpeg-encoder
I downloaded the source and then uploaded the .swf and the .php in the same directory. However, when I click "download your sketch," it downloads the .php file instead of a jpeg.
The .swf I uploaded can be seen here:
http://www.snut.org/storage/scrntest/sketch.swf
I didn't change any of the code from the source I downloaded, so I can't figure our what the problem is. Can anyone help?
Rule of thumb - any time your web server downloads .php files instead of rendering the output of the file it is a good sign that your server isn't set up to handle PHP. You need to tell Apache to use PHP, google around for "install PHP on Apache web server" and that should get you started.
Basically .php files are just text files, so unless you have something telling your web server to treat .php files different from normal text files then it'll just assume the user wants to download the file that's being linked.

Free Directory viewer using PHP / Ajax that can unzip an uploaded file

I'm not sure if this is the best place to ask this question. However, I accept the possiblity of the question being moved/deleted.
I current have a website that does some file processing if a directory name is provided (local file system). I take the input in an HTML form. I'm looking to incorporate a script that allows the user to upload files / see the directory structure within the website directory. (Instead of them having to remember the name of the folder). However, most importantly, I'm looking for the two following features:
-Ability to be able to click and unzip a .zip or .rar file that they upload (Very important).
-Ability to perhaps incorporate the project as a sidebar using frames (Not that important, I could modify the scripts index page, if I have to).
A really good script, I found online was http://www.filelistpro.com/features.html, however, the problem is that it doesn't handle the option for unzipping a file.
Ajaxplorer - Demo - login using demo/demo
More information - http://www.ajaxplorer.info

Combine multiple files and folders into one file using PHP

I have designed an online editor with which a user can create files and folders on the server. Suppose a user creates the below files and folders.
/docs/abc.txt
/docs/def.txt
/docs/work/assignment.txt
I want to write a PHP script to combine the files into a single ZIP file so that it makes it easier for the user to download them with one click.
The only purpose is that I should get a single file with the directory hierarchy maintained which the user can download and uncompress on his system to get the original files and directory structure back. I don't care even if the ZIP file is not compressed.
Note that I am using a shared server and do not have access to execute external commands.
ZipArchive class is what you need. Using this you can add directories and file to an archive.
This is a common requirement and has been solved. Try and check out this class: http://www.phpclasses.org/browse/package/2322.html
More tutorials at:
http://davidwalsh.name/create-zip-php <-- this has a similar example if you scroll down
http://www.w3schools.com/php/php_ref_zip.asp
Assuming you have permission to execute an external command, you could use exec to run an external command-line capable ZIP program such as 7-Zip.

Categories