Upload Via Url Script

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

#amarsong

16 replies · 3,264 views · started 18 years ago · 1 min read

TL;DR · summary of 16 replies
  • - The script provided does not handle spaces and special characters in file names.
  • - A timeout issue is being faced when uploading large files using the script on some servers.
  • - There was no clear solution or code approach given for these issues.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

12 participants
laro696 Developer · 205 posts #1

lol i feel like an idiot coz im the only one posting topics in this forum! anyway, i'm setting up a new download site, and wanna transfer all my files from my old host to the new one. nut i dont feel like uploading it all again. so what im looking for is a script where i can put in the file location, example http://myoldsite.com/file.zip and then in the config file, specify the directory where it must be uploaded to, example http://mynewsite.com/downloads

lol did that make sense?

think wen.ru's 'upload via url'

Guest #2

lol i feel like an idiot coz im the only one posting topics in this forum! anyway, i'm setting up a new download site, and wanna transfer all my files from my old host to the new one. nut i dont feel like uploading it all again. so what im looking for is a script where i can put in the file location, example http://myoldsite.com/file.zip and then in the config file, specify the directory where it must be uploaded to, example http://mynewsite.com/downloads

lol did that make sense?

think wen.ru's 'upload via url'

use the copy(); function..

khan1 Developer · 101 posts #3

use net2ftp.com just download nd upload n2ftp script to your server nd change size limit in 2ftp script or if script size is not big use net2ftp.com to transfer files from 1st server to 2nd server

laro696 Developer · 205 posts #4

use the copy(); function..

any1 care to explain how this works?

Guest #7

Will make it easy to understand for the author

  1. Make a folder in your server name it UPLOADS.
  2. CHMOD or Change Permission to 777.
  3. Create upload.php and paste the code below
<?php
$file = $_POST["file"];
if(isset($file)){
$fname= array_reverse(explode("/",$file));
if(copy($file,"UPLOADS/$fname[0]"){
echo "$fname[0] Succesfully Uploaded!";
}else{
echo "Error Uploading $fname[0]!";
}
}
?>
<form action="upload.php" method="post">
<input name="file">
<input type="submit" value="upload">
</form>

Let me know if theres an error i just do the code posting here LoL

GiLL Senior · 356 posts #8
<?
$file="http://youroldsite.com/filename.zip";

$fname= array_reverse(explode("/",$file));
if(copy("$file", "folder/$fname[0]")) echo "$file copyed
";
?>

make a php file and where is folder change it with your folder/dir name

left wap stuff

neostar Developer · 109 posts #9

laro696 wrote: lol i feel like an idiot coz im the only one posting topics in this forum! anyway, i'm setting up a new download site, and wanna transfer all my files from my old host to the new one. nut i dont feel like uploading it all again. so what im looking for is a script where i can put in the file location, example http://myoldsite.com/file.zip and then in the config file, specify the directory where it must be uploaded to, example http://mynewsite.com/downloads lol did that make sense?

think wen.ru's 'upload via url'

ok here is what i think u want:

<?php
$PHP_SELF = $_SERVER['PHP_SELF'];

if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name='from' value=''><br>
to(filename): <input name='to'><br>
<input type=submit value=\"transload\">";
}
?>

hope this will help u

  • Rajenra Pondel
pretend Developer · 107 posts #10

neostar wrote: ok here is what i think u want:

<?php
$PHP_SELF = $_SERVER['PHP_SELF'];

if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name='from' value=''><br>
to(filename): <input name='to'><br>
<input type=submit value=\"transload\">";
}
?>

hope this will help u

  • Rajenra Pondel

HOW DOES THIS WORK I MEAN How to get the file after upload after upload it shows the file name and the location but i am bit confused on this i need to setup a path and get the uploaded file to the desired path how? help thanks

Nice Effects

leonine Developer · 130 posts #11

But this script doesn't download force files. Like the name of file is with space and % and special characterstic then it doesn't transfer..

This is my new community for wap coding. Come and join and experience real wap coding http://leonine.6te.net

HiTMan_47 Newbie · 2 posts #12
<?php $file = $_POST["file"]; if(isset($file)){ $fname= array_reverse(explode("/",$file)); if(copy($file,"UPLOADS/$fname[0]"){ echo "$fname[0] Succesfully Uploaded!"; }else{ echo "Error Uploading $fname[0]!"; } } ?> <form action="upload.php" method="post"> <input name="file"> <input type="submit" value="upload"> </form>

Hey THANX for this script, I've use it on my 4m. (mybb forum)

But I faced a problem After filling a download link & giving file name(with & without extention) i click transload, but my file is not getting uploaded on my forum, it shows error>> "The specified thread does not exist."

what to do man?? plz help me.

HiTMan_47 Newbie · 2 posts #13

hey plz help me.......anyone plzzzzzzzzz

mayurss786 Developer · 137 posts #15

anthrax68 wrote: Please help in that script to get the filesize and filetype because I'm using it in filesharing site. Thanks

filesharing site does not allow url upload

irfiii Developer · 249 posts #16

Timeout Problem

i am facing timeout problem .. i try to uplad on santrex but after 370mb ( i think in 60 or 90 Seconds) its give Timeout Error. how to increase timeout?

Free Web Hosting @HostersPoint.com php Hosting with Web Builder

Buy - Sell ADs ADMOLA ADs Network Monetize Your Site Traffic

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