FTP from x10 to home pc

Status
Not open for further replies.

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
I need to allow my users to send me files that may be up 500MB. Since x10 does not allow uploads bigger than 16MB and would seem not to even allow files of that size, as they call it file hosting, even though these files would only be accessible by myself and would be deleted as soon as I download them, I need to find a way to send these files to my home pc without them being stored on x10.

I imagine this would involve using PHP's ftp_put and setting up a secure ftp server on my pc, but I'm not really sure how to do that, or maybe there is a simpler way.

Ideas?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Have you looked into services like Dropbox (free account)?
 

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
Does Dropbox have an API? I don't want the users to be able to log in to a service like Dropbox manually because then they could delete other users files, etc.
 

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
OK, wow it does have an API and it looks good, thanks! I think my main worry is how x10 would look at this. What I mean is, even if I'm uploading to Dropbox, the file will have to exist on X10's servers first, right? Even if it's only in RAM? I don't really know how it works but I'm worried x10 may still limit these kinds of uploads to 16MB
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
No. You would set it up separate from x10.
Members upload to your Dropbox. You download.
 

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
Sorry I'm such a newb at this, but wouldn't x10 be involved if I have the upload form on my x10 website?
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
If the form doesn't submit to a file on the x10 account, and instead submits directly to Dropbox, the upload wouldn't touch our servers and would be fine. My concern is if you have to direct it to a php file on the x10 account, there's an extremely high chance that the server will automatically kill the process due to an execution time limit or high resource usage, as uploading 500+mb isn't going to be done in a few seconds.

If all else fails you may want to look into a VPS or some other form of file storage service that better supports user-uploads for large files of this nature.
 

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
Is anybody here familiar with the Dropbox API? I have signed up and FTPed the API to my site. I have also created an app on their site and gotten an app Key and Secret, and uploaded that in the form of a JSON file. Below is their example for a file upload. Would I just point the form to this code?

Code:
#!/usr/bin/env php
<?php

require_once __DIR__.'/helper.php';
use \Dropbox as dbx;

list($client, $sourcePath, $dropboxPath) = parseArgs("upload-file", $argv, array(
        array("source-path", "A path to a local file or a URL of a resource."),
        array("dropbox-path", "The path (on Dropbox) to save the file to."),
    ));

$pathError = dbx\Path::findErrorNonRoot($dropboxPath);
if ($pathError !== null) {
    fwrite(STDERR, "Invalid <dropbox-path>: $pathError\n");
    die;
}

$size = null;
if (\stream_is_local($sourcePath)) {
    $size = \filesize($sourcePath);
}

$fp = fopen($sourcePath, "rb");
$metadata = $client->uploadFile($dropboxPath, dbx\WriteMode::add(), $fp, $size);
fclose($fp);

print_r($metadata);
 

maelhorn

New Member
Messages
16
Reaction score
0
Points
1
Also would like to say for the record these files would be legal and the uploaders would own copyright to them.
 
Status
Not open for further replies.
Top