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

  • SEARCH
  • Home
  • 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 8490963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:16:42+00:00 2026-06-10T22:16:42+00:00

I have two servers, one with my website, the other for storage. I’m trying

  • 0

I have two servers, one with my website, the other for storage. I’m trying to have a page where someone can upload a file to the storage server, I’m hoping to use a form post to get it there. I’ve written a very simple bit of code to troubleshoot this and am having a little trouble. It works fine if I change the action to a .php that saves it on the same server, but when I change it to my storage server, it fails to upload and shows me the “else” echo that my fail failed to upload.

the HTML on my web server:

<form action="http://storageServer/upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 
<br />
<input type="submit" name="submit" value="Submit" />
</form>

The PHP on my storage server:

<?php
$folder = "files/";
$path = $folder . basename( $_FILES['file']['name']); 
if(move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
echo "The file ".  basename( $_FILES['file']['name']). " has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>

The .php is in the html folder with the “files” folder.

Any reason the file isn’t making it to the server that you can see?

  • 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-10T22:16:44+00:00Added an answer on June 10, 2026 at 10:16 pm

    This topic answers your question

    As suggested, you could use CURL:

    $ch = curl_init("http://www.remotepage.com/upload.php"); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, array('fileupload' => '@'.$_FILES['theFile']['tmp_name'])); 
    echo curl_exec($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two servers - one Django, the other likely to be written in
I have two Android devices. One is acting as a server and the other
I have a website (asp.net,c#) on two different servers (same source code). In one
I have two tables in Sql Server, one containing IDs for files and the
In SQL Server 2008 I have two tables. One table for users: id_user -
In SQL Server 2008: I have two tables, dtlScheme and dtlRenewal, with a one
I have two servers where I installed SQL Server 2008 Production: RAID 1 on
You have two servers when you perform a SQL Server database mirroring You have
I have two servers: Fedora running Apache/2.2.14 (old server) CentOs running Apache/2.2.3 (new server)
I have two separate websites on the same server. One site is a forum

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.