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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:42:46+00:00 2026-05-25T20:42:46+00:00

I have a script to upload files to the server from your computer. It

  • 0

I have a script to upload files to the server from your computer. It works fine and basically it’s a

<form enctype="multipart/form-data" action="post_img_upload.php?id='.$topicid.'" method="POST">
<input name="uploaded_file" type="file" />
<input type="submit" value="Subila" />

then, the post_img_upload.php starts like this:

 $target = "pics/"; 

$fileName = $target . $_FILES["uploaded_file"]["name"];           // The file name
$fileTmpLoc = $_FILES["uploaded_file"]["tmp_name"];     // File in the PHP tmp folder
$fileType = $_FILES["uploaded_file"]["type"];           // The type of file it is
$fileSize = $_FILES["uploaded_file"]["size"];           // File size in bytes
$fileErrorMsg = $_FILES["uploaded_file"]["error"];      // 0 for false... and 1 for true
$fileName = preg_replace('#[^a-z.0-9]#i', '', $fileName); // filter the $filename
$kaboom = explode(".", $fileName);                      // Split file name into an array using the dot
$fileExt = end($kaboom);    

Now I want to have the option to upload a file having an url address. Another form basically with

<form action="post_img_url_upload.php?id='.$topicid.'" method="POST">
<input name="url" type="text" size="100" /> 
<input type="submit" value="Copiar"/>

I would like to have post_img_url_upload.php similar to the post_img_upload.php.
How can I approach that?
How can I basically write

$fileName = $target . $_FILES["url"]["name"];

? Is it doable?
Thanks!

  • 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-05-25T20:42:46+00:00Added an answer on May 25, 2026 at 8:42 pm

    AFAIK, no. The server would only get the url string, and then should try to fetch the image itself (instead of the image data being transferred from the client). You could google for “php external request” as there are a couple of ways to do it (cURL, remote file access, etc.).

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

Sidebar

Related Questions

I have a php-script that uploads files to an ftp server from a location
I have a bash script to upload some files to my webserver. The problem
So I have my upload script working just fine, but now it's a matter
I have a ajax image upload script which i found here http://www.fengcool.com/2009/06/ajax-form-upload-local-image-file-without-refresh/ The problem
I have a script that performs some simple editing which works fine, the problem
I have used the a jquery script that is used to upload files: http://aquantum-demo.appspot.com/file-upload
I have two FTP server a and b, I need to copy files from
I want to upload files from a client location to a server. At present,
I have an upload script that write a index.html file, I modified it to
So I have an upload script, and I want to check the file type

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.