Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4260
Latest: Verrick
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43306
Total Topics: 7525
Most Online Today: 662
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 198
Total: 198

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - nitins60

Pages: [1]
1
Feature Requests / ?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

Pages: [1]

+- Recent Topics

Attachment images Upsidedown or Sideways by SMFHacks
June 10, 2024, 04:00:21 pm

“Insert from Gallery” by donk
June 10, 2024, 01:26:57 pm

Pretty Urls extras by SMFHacks
May 13, 2024, 10:28:54 am

Mod question by Verrick
May 11, 2024, 02:42:50 pm

i have paid but cant download ad pro. by SMFHacks
May 02, 2024, 11:29:38 pm

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

Powered by EzPortal