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 7822881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:03:43+00:00 2026-06-02T08:03:43+00:00

I want to create an application server that serves html content which contains links

  • 0

I want to create an application server that serves html content which contains links to static images served by another server on a different domain. The images are uploaded by users through the application server.

This is what I would do to upload a JPEG file to the application server:

if(!file_exists("folder_name")) mkdir("folder_name", 0770);
$temp_file = $_FILES['image']['tmp_name'];
$im = imagecreatefromjpeg($temp_file);
$destination = "folder_name/file_name.jpg";
imagejpeg($im, $destination);
imagedestroy($im);

How would the code be changed if I were to upload the file to another server instead?

Add Note: The folders are to be created on the fly if it doesn’t exist.

  • 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-02T08:03:44+00:00Added an answer on June 2, 2026 at 8:03 am

    Mostly depends on what you can use.

    You can do it with secure SFTP:

    $connection = ssh2_connect('shell.example.com', 22);
    ssh2_auth_password($connection, 'username', 'password');
    
    ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644);
    

    PHP manual here: function.ssh2-scp-send.php

    Or unsecure FTP:

    $file = 'somefile.txt';
    $remote_file = 'readme.txt';
    
    // set up basic connection
    $conn_id = ftp_connect("ftp.example.com");
    
    // login with username and password
    $login_result = ftp_login($conn_id, "username", "password");
    
    // upload a file
    if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
     echo "successfully uploaded $file\n";
    } else {
     echo "There was a problem while uploading $file\n";
    }
    
    // close the connection
    ftp_close($conn_id);
    

    PHP manual here: function.ftp-put.php

    Or you could send HTTP request using PHP:

    This is more like real web browser behavior as seen by another server:

    You can use socket_connect(); and socket_write();, I will add more information about those later.

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

Sidebar

Related Questions

I am new to Guice. I want to create a server application with RESTful
I want to create application which would display spatial data on Map. I'm thinking
I want to create an application which main window has canvas (or something where
I want to create an application for Android that will be able to scan
I want to create an application that doesn't use Portrait mode. I am not
I want to create an application that performs a particular action when the device
Problem I want to create an application that can be extended somehow by programmers.
I want to create an application that runs on the users computer, a stand-alone
I want to create an object which represents an html document which is suppose
I want to create a simple web based application on Android that loads certain

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.