Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:02:41+00:00 2026-06-18T05:02:41+00:00

Can somebody help with this script? I’m looking for upload via url to my

  • 0

Can somebody help with this script?

I’m looking for upload via url to my server.

I saw many of options but no one does not work for me.

This is what I’m trying to do

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<script type="text/javascript">
//Alerts to errors.
window.onerror=function(msg, url, linenumber){var logerror='Error message: ' + msg + '. Url: ' + url + 'Line Number: ' + linenumber;alert(logerror);return false}
</script>
<title>Upload Form</title>
<style type="text/css">
body
{
margin: 0 auto;
width:900px;
font-family:serif
}
#upload_box
{
background-color: LightBlue;
border:1px solid Black;
padding:20px;
margin-top:40px;
width: 50%;
}
</style>
<?php
if (isset($_POST['myupload']))
{
    define('BUFSIZ', 4095);
    $url = $_POST['upload'];
    echo 'Trying with fread() ';
    $target = 'up/';
    $nname = basename($url);
    $info = pathinfo($url);
    var_dump($info);
    $parse = parse_url($url);
    echo '<br/><br/>';
    if(isset($_POST['nname'])){
        $nname = $_POST['nname'];
    }
    if(fopen($url, 'rb')){
        $rfile = fopen($url, 'rb');
        $lfile = fopen($target.$nname, 'wb');
        while(!feof($rfile)){
            fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);
            fclose($rfile);
            fclose($lfile);
        }
    }else{
        echo "Can't read from this directory";
    }
    $fp = fsockopen($parse['host'], 80, $errno, $errstr, 300);
    if (!$fp) {
        echo "$errstr ($errno)<br />\n";
    } else {
        $out = "GET / HTTP/1.1\r\n";
        $out .= "Host: ".$url."\r\n";
        $out .= "User-Agent: Mozilla/5.0 Firefox/3.6.12\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);
        while (!feof($fp)) {
            echo fgets($fp, BUFSIZ);
        }
        fclose($fp);
    }
}

?> 

</head>
<body>
<div id="upload_box">
<form action="" method="post">
<input type="text" name="upload"><label>URL</label><br/>
<input type="text" name="nname"><label>NEW Name</label><br/>
<input type="submit" name="myupload" value="Upload File">
</form>
</div>
</body>
</html>

and the result is:

Warning: fopen(http://xxx.co.uk/xxxx/xxxx.mp3):  failed to open stream: Permission denied in

and for fsockopen is the same problem

Warning: fsockopen(): unable to connect to xxx.co.uk:80 (Permission denied) in xxx/index.php on line 53
Permission denied (13)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:02:42+00:00Added an answer on June 18, 2026 at 5:02 am

    i found it

    it was a outgoing connection on my host

    allowed all and fixed 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can somebody please help me with this mail script. I'm simply trying to send
Can somebody help me out to troubleshoot this code? I am looking to add
I hope somebody can help me with this. I have a script that generates
Can somebody help me with this. There is HTML code: <h3> <label> <input type=checkbox
Heyy can somebody help me ? i have this issue that still do know
Sure it's a simple question, but I can't fix it, can somebody help me?
Can somebody help me? The following code works, but unfortunately a function call to
I hope somebody can help me, i am oop starter and the script below
Hi I am hoping that somebody can help me to tweak this JQuery code
I hope somebody can help work out to do this. Basically, I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.