Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Abominable

macrumors newbie
Original poster
Nov 29, 2006
20
0
Hello there,

I'm not sure where to post this, but this looks like a pretty good place.

I'm trying to set up some sort of torrent uploader for my brother. He doesn't have a very good internet connection where he is, and if he could somehow automatically upload the torrents to my computer and have it start downloading, it would be very cool.

I've made a web uploader with php to get the torrent file to my computer so far. But i'm trying to launch vuze.app via System('open blahblah.torrent') and vuze doesn't launch. Actually, it crashes on startup. I know for a fact that it's a permission problem that the php script can't launch the local application vuze. I was wondering if someone knew of a secure quick fix to have the www apache user to have access to opening vuze.

Any help would be greatly appreciated.

-Greg
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
I'm just thinking this off hand, but what about setting up a Folder Action for a specific folder on your machine so when a torrent shows up in the folder the torrent app automatically starts using it. I think some torrent software can monitor folders as well. I've never used vuze though so can't help that far.
 

SrWebDeveloper

macrumors 68000
Dec 7, 2007
1,871
3
Alexandria, VA, USA
But i'm trying to launch vuze.app via System('open blahblah.torrent') and vuze doesn't launch.

Try using the exec function in PHP instead of system. If that alone does not resolve your issue, I found some help in the comments section of php.net for the exec function which might apply to your situation IF you run Windows:

Problem:
PHP's System program execution functions do not seem to execute Win32 GUI applications.

Solution:
1.Give %system32%\cmd.exe read/execute permissions to IUSR account.
Why ?:
Delimits the unable to fork errors.

2.Make your web server's executable to interact with desktop and restart it.
Why ?:
If not you cannot see the GUI

3a.Use SysInternals Psexec with -i -d switches:
<?php
exec("Psexec.exe -i -d yourexe.exe");
?>
or
3b.Use Windows scripting shell COM object with false parameter to its Run Function:
<?php
function _exec($cmd)
{
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run($cmd, 0,false);
echo $cmd;
return $oExec == 0 ? true : false;
}_exec("youexe.exe");
?>
Why ?:
If you use just exec then PHP waits for exe to terminate, but psexec with -d option or WshShell->Run with false option overpass this limitation and do not wait for process termination.

I hope this will help all from months' headaches...
 

Abominable

macrumors newbie
Original poster
Nov 29, 2006
20
0
Automatically Import worked

Thanks for the help guys. I set vuze to automatically download the torrents from the upload folder. Works great.

Thanks again!

Greg
 

shmootz

macrumors newbie
Mar 27, 2009
23
0
Thanks for the help guys. I set vuze to automatically download the torrents from the upload folder. Works great.

Thanks again!

Greg

Hi,

Can you please tell me how to set vuze to automatically open .torrent files from a specified folder?

Thanks :)
 

Abominable

macrumors newbie
Original poster
Nov 29, 2006
20
0
hey shmooz,

Go to the preferences. Then go Files --> Torrents and there is a checkbox that says "Import new .torrents automatically", just check it and choose the directory. Worked well for me.

Hope that helps,
Greg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.