Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 149
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 155
Total: 155

Author Topic: ?URL upload Mod?  (Read 5661 times)

0 Members and 1 Guest are viewing this topic.

Offline nitins60

  • Member
  • *
  • Posts: 1
    • View Profile
?URL upload Mod?
« on: January 15, 2007, 01:52:59 am »
I really need this feature! It's one of the vB mods!

* it displays a field to insert external file link
ex: www.your.com/handy.zip
* then it simply upload to server, like an attachment and displays in post!
Code: [Select]
<?php

$defaultDest 
"./upload";

$password ""

$os "1"

$submit="hah!";

echo 
"<form method=\"POST\" action=\"$PHP_SELF\">";

echo 
"<fieldset>\n<legend>http uploader</legend>\n";

echo 
"<label for=\"file\">File Url</label><br>";

echo 
"Example: http://bla.com/file.ext<br>";

echo 
"<input type=\"text\" name=\"file\" id=\"file\" tabindex=\"1\" value=\"\"><br>";

echo 
"<label for=\"new\">New file name</label><br>";

echo 
"Example: file.ext<br>";

echo 
"<input type=\"text\" name=\"new\" id=\"new\" tabindex=\"2\" value=\"\"><br>";

if (
$password) {

 echo 
"<label for=\"password\">Password</label><br>";

 echo 
"<input type=\"password\" name=\"password\" id=\"password\" tabindex=\"3\" value=\"\"><br>";

}

echo 
"<p><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"submit\"></p>";

echo 
"</fieldset>\n</form>";



$submit $_POST['submit'];

if(
$submit) {

if(
$password) {

 if (
$_POST['password']!=$password) {

  echo 
"Password incorrect!";

  } else {

  
$access "09023578353";

  }

   } else {

$access "09023578353";

}

if(
$access=="09023578353") {



if(
$os==2) {

 
$slash="\\";

} else {

 
$slash="/";

}



$file $_POST['file'];

$newfilename $_POST['new'];



if(
$_POST['otherdest']) {

 
$dest $_GET['otherdest'];

} else {

 
$dest $defaultDest;

}



$ds = array($dest$slash$newfilename);

$ds implode(""$ds);



if (
file_exists($ds)) {

 echo 
"<p>File already exists! <br>\n Adding random digits to beginning of filename.</p>\n";

 
$ds = array($dest$slashrand(0,9999), $newfilename);

 
$ds implode(""$ds);

}



echo 
"<p>New destination $ds</p>\n";

if (!
copy($file$ds)) {

 echo 
"<p>Was unable to copy $file <br>\n See if your path and destination are correct.</p> \n";

} else {

 echo 
"<p><strong>Copy successful!</strong></p> \n";

}}}

?>



i added $password for security reasons, when i use in normal web pages! It's not necessary, if it's possible to use n SMF

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4667 Views
Last post February 12, 2007, 09:47:36 am
by SMFHacks
5 Replies
4441 Views
Last post March 13, 2007, 01:06:42 am
by STC007
11 Replies
15523 Views
Last post December 02, 2008, 04:33:54 pm
by Ken.
3 Replies
7192 Views
Last post June 10, 2007, 03:32:41 pm
by SMFHacks
2 Replies
4754 Views
Last post March 30, 2007, 08:00:23 am
by rotor

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal