google-code-export / rtgui

Automatically exported from code.google.com/p/rtgui
1 stars 0 forks source link

Torrent upload & start #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Click Add torrent
2. Browse a file
3. Click go

What is the expected output? What do you see instead?
The file should be uploaded then added to rtorrent.
The file has been uploaded but it is not added to rtorrent.

What version of the product are you using? On what operating system?
rtGui 0.2.6, Debian 4.0, 2.6.18-6-486

Please provide any additional information below.
Add the do_xmlrpc line to control.php:

if (move_uploaded_file($_FILES['uploadtorrent']['tmp_name'],
$watchdir.basename($_FILES['uploadtorrent']['name']))) {                  

    $response = do_xmlrpc(xmlrpc_encode_request("load_start",
array($watchdir.basename($_FILES['uploadtorrent']['name']))));            

    header("Location: index.php");^                                       

} else {...

Original issue reported on code.google.com by berlikl@gmail.com on 3 Jan 2009 at 7:00

GoogleCodeExporter commented 9 years ago
I'm guessing you haven't got a watch directory set up properly in your 
.rtorrent.rc 
file?

The add file option moves the uploaded file to the watch directory, then it's 
up to 
rTorrent to deal with it.

However, I'll add this code as I can see it being of benefit to others.

Original comment by lemonbe...@gmail.com on 8 Jan 2009 at 8:53

GoogleCodeExporter commented 9 years ago
Is there such a setting of rtorrent?
It's my fault, I did not know about that :-)

Original comment by berlikl@gmail.com on 8 Jan 2009 at 11:19

GoogleCodeExporter commented 9 years ago
Berlikl,

Have a look at
http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Watchadirectoryfortorrent
s for
details on how to set up a watch directory plus many other useful commands for 
rtorrent.

Original comment by ama...@gmail.com on 10 Jan 2009 at 10:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
this will work also

change in control.php
// Upload torrent file...
if (isset($r_uploadtorrent)) {
   if ($_FILES['uploadtorrent']['name']!="") {
      $tmpfile=$_FILES['uploadtorrent']['name'];
      if (move_uploaded_file($_FILES['uploadtorrent']['tmp_name'],
$watchdir.basename($_FILES['uploadtorrent']['name']))) {
         header("Location: index.php");
      } else {
         echo "Error moving file - check permissions etc!  <a
href=index.php>Continue</a>.\n";
      }
      die();
   }
}

to
// Upload torrent file...
if (isset($r_uploadtorrent)) {
   if ($_FILES['uploadtorrent']['name']!="") {
      $tmpfile=$_FILES['uploadtorrent']['name'];
      if (move_uploaded_file($_FILES['uploadtorrent']['tmp_name'],
$watchdir.basename($_FILES['uploadtorrent']['name']))) {
          @chmod($watchdir.basename($_FILES['uploadtorrent']['name']), 0777);
         header("Location: index.php");
      } else {
         echo "Error moving file - check permissions etc!  <a
href=index.php>Continue</a>.\n";
      }
      die();
   }
}

I recommend setting the permissions. Since the apache user may not be the same 
as the
rtorrent user.

I haven't done a lot of testing on this but it works. I think rtorrent wants -x 
on
torrents.

Original comment by cmos8...@gmail.com on 26 Jan 2009 at 4:12

GoogleCodeExporter commented 9 years ago
Fixed in version 0.2.7

Original comment by lemonbe...@gmail.com on 16 Mar 2009 at 10:19