Url instead of upload

  • splinner
  • Newbie
  • Newbie
  • User avatar
  • Joined: Feb 23, 2009
  • Posts: 13
  • Status: Offline

Post March 3rd, 2009, 2:15 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 3rd, 2009, 2:15 am

  • dark_lord
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jan 14, 2009
  • Posts: 162
  • Loc: India-Kolkata
  • Status: Offline

Post March 4th, 2009, 10:27 pm

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
Wrap Up your Big Url | Mariana World Community
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post March 4th, 2009, 11:33 pm

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
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • splinner
  • Newbie
  • Newbie
  • User avatar
  • Joined: Feb 23, 2009
  • Posts: 13
  • Status: Offline

Post March 5th, 2009, 12:39 am

theres no way i can change a <input type="file" name="imguload" /> into something like <input type="text" name"imguload" /> ?
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 5th, 2009, 5:31 pm

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. }
Strong with this one, the sudo is.
  • kirkhowell
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Mar 05, 2009
  • Posts: 6
  • Status: Offline

Post March 5th, 2009, 7:57 pm

I had same problem, thanks.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 179 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.