Url instead of upload

  • splinner
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

How do I make A form box where you input a url i.e "tinypic.com/img/83982038jdksjd" and it will post the image. This will replace a upload function i.e click browse windows pops up, you select image
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • dark_lord
  • Graduate
  • Graduate
  • User avatar
  • Posts: 162
  • Loc: India-Kolkata

Post 3+ Months Ago

use php file function to get that image read by you and store (if required)
and if you don't know how to use file functions, then forget about it
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

For more information on how to use the PHP file function you see it here:

http://www.php.net/file
Moderator Remark: De-localized php.net link
  • splinner
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

theres no way i can change a <input type="file" name="imguload" /> into something like <input type="text" name"imguload" /> ?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Sure you can, but unless you modify the the script which works with the upload as well making that swap would be pointless.

The easiest thing to do is probably going to be to wrap the existing section of the script which works with the image in an elseif statement, then add an if statement above that checks for the existance of $_FILES['field_name'].

For instance

Code: [ Select ]
if(empty($_FILES['field']))
{
// Check for and work with URL
}
else
{
// Existing script working with an upload
}
  1. if(empty($_FILES['field']))
  2. {
  3. // Check for and work with URL
  4. }
  5. else
  6. {
  7. // Existing script working with an upload
  8. }
  • kirkhowell
  • Newbie
  • Newbie
  • kirkhowell
  • Posts: 6

Post 3+ Months Ago

I had same problem, thanks.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: Liamw411 and 57 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.