Transfer File By Url

Started on the old forum in April 2007 · view the original in the archive · old links redirect here

10 replies · 2,061 views · started 19 years ago · 1 min read

6 participants
Guest #3

how to config this file wizard brou?

<?php
defined('_ALLOWINCLUDE') or die();

// Default destination to copy files too NO TRAILING SLASH!!
// If it is complete path, file be copied there ex: /home/public_html/FOLDER (Linux), C:\htdocs\FOLDER (Windows)
// If it is just a direcotory it will be copied to that directory in directory the script is in ex: /SnatcherFolder/FOLDER
$defaultDest = 'snatched';
    /*
    More examples
    If $defaultDest = ''; it will automatically copy to the `snatched` directory inside of the script's directory.
    If $defaultDest = 'files'; it will copy to `files` directory inside of the script's directory.
    */

// If you want a password to be required
// Remember if you don't have a password anyone can copy a file to your server!
$password = ''; 

// URL to location of snatched files WITH OUT TRAILING SLASH
$URLDest = '[url]http://example.com/snatched';[/url]

// Put a limit for file size in kilobytes (1024KB is 1MB)
// For unlimited put 0
// Example $sizelimit = 25;
$sizelimit = 0;

?>

where and how to use add dir where files will get uploaded?and where to put password and how to put limait of file size brou?

amylee Principal · 1,092 posts #7

wget? lol thats if you got shell access

GumSlone Administrator Principal · 1,690 posts #9

Try this code, but it does not work with all files.

<?
$file="http://mysite.com/folder1/folder2/file.gif";
$fname= array_reverse(explode("/",$file));
if(copy("$file", "local_folder/$fname[0]")) echo "$file copyed
";
?>

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

chatabox Senior · 361 posts #10

lol, i was just laughing and about to say its just the copy code.. just make sure the destination diectory is 0777/writable or it will fail.

$file = '[url]http://w4p.us/pics.zip';[/url]
copy($file, 'somefolder');
darkdesire Senior · 250 posts #11

Does anyone know of a similar script wap or web that can copy entire folders in one go ?

:p:p:p

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close