Rutorrent fileshare plugin does not work

Always results in “no such file” when using the generated link.

I suspect an apache/php configuration issue but I don’t know enough about it to even know where/what to look for…googling only finds people with the same problem and no answers :disappointed:

*Added to my things to do for today

I highly doubt it’s an apache or php configuration issue, as the following is the config for the fileshare plugin:

<Directory "/srv/rutorrent/home/fileshare">
    Options -Indexes
    AllowOverride All
    Satisfy Any
</Directory>

The share.php file needed for the arrangement of shares is set within this directory as a symlink to the fileshare itself.

# la -l /srv/rutorrent/home/fileshare
total 4.0K
-rw-rw-r-- 1 www-data www-data 12 Nov  6 09:00 .htaccess
lrwxrwxrwx 1 www-data www-data 33 Jan 26 14:15 share.php -> ../../plugins/fileshare/share.php

Within the share.php file we have the following:

<?php
if(!isset($_GET['uh'])) {die('Invalid link');}
$_SERVER['REMOTE_USER'] = base64_decode($_GET['uh']);
require_once( dirname(__FILE__)."/../../php/util.php" );

if(getConfFile('config.php') === FALSE) {die('No such file');}

require_once( dirname(__FILE__)."/../filemanager/flm.class.php" );
include( dirname(__FILE__).'/share.class.php');

$f = new FSHARE();

if(!isset($_GET['s']) || !isset($f->data[$_GET['s']]) || ($f->data[$_GET['s']]['expire'] < time())) {die('No such file or it expired');}

function authenticate() {
    header('WWW-Authenticate: Basic realm="LEAVE USERNAME EMPTY!! Password only!"');
    header('HTTP/1.0 401 Unauthorized');
    echo "Not permitted\n";
    exit;
}


if (!isset($_SERVER['PHP_AUTH_USER']) || ($_SERVER['PHP_AUTH_PW'] != $f->data[$_GET['s']]['password'])) {authenticate();} else {



$f->workdir = '';

$f->send_file($f->data[$_GET['s']]['file']);

}
?>

Now, everything here seems OK, though, I am not ruling this out. I’ll run a few tests to see where I end up. Could be that this is a third-party plugin that’s fallen behind on supporting the latest in rutorrent updates… but I am only guessing in this regard.


Update

Just tested on a local server.

Step 1. Navigated to the file for sharing via the File Manager tab in RUTorrent.
step1

Step 2. Right Click on the file to share in the File Manager tab and selected share.
step2

Step 3. In the File Share dialog I entered the Duration (hours): as 1 and within the Password: I entered a password.
step3

Step 4. Navigated to the File Share tab and Right Clicked the download link that was generated, then selected the option Copy link.
step4

Step 5. Is obvious, I pasted the generated fileshare link in the browser and navigated to the page. A dialog pops up (typical browser authentication) asking for Username and Password. I left the Username field blank and entered the Password I created for the fileshare in Step 3. From there I had to wait about 30 seconds, at which point, the file started downloading.
step5




If there is anyone else having issues with the Fileshare plugin, it’d be great to hear from you. This way we can best narrow down potentialities.



Interesting…thanks for taking a look. I just tried a few more times, different durations, with and without password, same thing…“no such file” :confused:

The reason I suspected apache/php is a solution from another forum that referenced that as an issue, but it was for nginx…something about “nginx is not configured to run .php there. Edit the nginx config and add this to the corresponding server block…” I thought maybe it was the same problem, but with apache.

I guess not though, since its working for you…no idea what it could be. This is a brand new clean install on Ubuntu 16.04.

If you like, I can PM you here within the hour and check this on your server? There is also the NextCloud option we could review.

Sure, if you want to take a look that’d be great.
I just noticed this, PM any time in case I missed you just now…I’ll try and leave this window up

I suspect the reason it doesn’t work for many of us, is because there is http authentication for each quickbox user already, and the fileshare plugin must be in a location where there is no auth:

create a symlink to /fileshare/share.php outside the AUTH protected space (domain.com/noauth/share.php, cdn.domain.com/fshare.php, etc)
plugin github

How would one do this on Quickbox? For me, even the root webserver dir asks for auth.

Hi, I have the same problem, have you found how to fix this ?

Thanks

The http://mydomain.com/share.php doesn’t work anymore and its not really user friendly to go on a public domain (need to pay another server…).

I am also having this problem… Any updates on this?

Same at me. Something new?
A few months back I used this plugin without problems, but now…

Ok since no one answered here I’m giving my solution to that problem. I’ve gone through all files and code and realized that the file conf.php had a line that is not working for me at least:

$limits[‘duration’] = 0; // maximum duration hours
$limits[‘links’] = 0; //maximum sharing links per user
$downloadpath = $_SERVER[‘HTTP_HOST’] . ‘/fileshare/share.php’;

The last line is not working and I think it is $_SERVER[‘HTTP_HOST’].
Once I switched it out with my actual domain it worked.