Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12375
Latest: scuzzy
New This Month: 2
New This Week: 1
New Today: 0
Stats
Total Posts: 40218
Total Topics: 7083
Most Online Today: 85
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 75
Total: 76

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

0 Members and 1 Guest are viewing this topic.

Offline nitins60

  • Newbie
  • *
  • 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
4118 Views
Last post February 12, 2007, 09:47:36 am
by SMFHacks
5 Replies
3920 Views
Last post March 13, 2007, 01:06:42 am
by STC007
11 Replies
14332 Views
Last post December 02, 2008, 04:33:54 pm
by Ken.
3 Replies
6103 Views
Last post June 10, 2007, 03:32:41 pm
by SMFHacks
2 Replies
3698 Views
Last post March 30, 2007, 08:00:23 am
by rotor

+- Recent Topics

Download System Lite by Rock Lee
June 03, 2020, 07:34:24 pm

Font question by SMFHacks
May 27, 2020, 08:15:26 am

Error message with latest SMF 2.1 Github build by Hatshepsut
May 25, 2020, 01:43:26 am

smfblog not working on 2.0.17 by tech9
May 20, 2020, 01:44:34 pm

Copyright removal by stbc
May 18, 2020, 01:27:57 am

Mod Verified User i can't square the image by Rock Lee
May 07, 2020, 07:56:10 pm

SMF4Mobile 2.0 released for SMF 2.0.x by SMFHacks
May 06, 2020, 12:13:14 pm

SMF Social Login Pro - Discontinued? by Nicole
May 02, 2020, 05:47:04 pm

Likes by SMFHacks
April 30, 2020, 09:50:35 pm

Upgrade Issue - by SMFHacks
April 28, 2020, 12:40:13 pm

Powered by EzPortal