Jump to content


Photo

file upload


  • Please log in to reply
5 replies to this topic

#1 Deserteye

Deserteye
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationNew Jersey

Posted 29 October 2006 - 09:04 PM

how would I upload a file using a link?

What I know:
XHTML: 10/10
CSS: 8/10
JavaScript: 5/10
VBScript: 7/10 PHP: 8/10 MySQL: 9/10

#2 Destruction

Destruction
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 29 October 2006 - 09:56 PM

File uploads require POST method to be used and links use GET.  It cannot be done unless I'm misunderstanding what you're asking.

Dest

#3 Deserteye

Deserteye
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationNew Jersey

Posted 30 October 2006 - 01:40 AM

File uploads require POST method to be used and links use GET.  It cannot be done unless I'm misunderstanding what you're asking.

Dest

you know how you can type in a link to an image on photobucket or imageshack and it will upload it to your gallery.. how would I do that?

What I know:
XHTML: 10/10
CSS: 8/10
JavaScript: 5/10
VBScript: 7/10 PHP: 8/10 MySQL: 9/10

#4 Destruction

Destruction
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 30 October 2006 - 11:59 AM

Okay so what you actually mean is to download an image to your server from another site?  Often called transloading (site->site).  You may want to look at the File Handling section of the manual particularly file_get_contents, or the fsockopen etc.  I'm on a bit of a flyby visit but if I get chance in a bit I'll post an example up to get you started if needed.

Dest

#5 Deserteye

Deserteye
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationNew Jersey

Posted 30 October 2006 - 07:52 PM

Okay so what you actually mean is to download an image to your server from another site?  Often called transloading (site->site).  You may want to look at the File Handling section of the manual particularly file_get_contents, or the fsockopen etc.  I'm on a bit of a flyby visit but if I get chance in a bit I'll post an example up to get you started if needed.

Dest

yeah thats wut I mean. an example would be great if you could. I'm not to sure how I would do it.

What I know:
XHTML: 10/10
CSS: 8/10
JavaScript: 5/10
VBScript: 7/10 PHP: 8/10 MySQL: 9/10

#6 Destruction

Destruction
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 31 October 2006 - 03:07 PM

Here's an example directly from User Comments on the File Handling Functions section of the manual.
<?php
$url = "http://nu-imaging.com/catalog/"; // here we have redirect to /catalog/1/
$fp = fopen($fp);
echo fread($fp, 1024); // we get content of /catalog/1/
fclose($fp);
?>

If you wanted to store it, you'd be best storing fread in a variable instead of echo'ing it.  The principle is the same.  However, you will need to have the allow_url_fopen ini option enabled.

Hope this helps, sorry for the delay,

Dest




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users