Jump to content

Download a file

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
14 replies to this topic

#1
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
I've search google and can not find an answer. I would like to download a file such as an image and save it to a directory???

How??

#2
Guest_sn17_*

Guest_sn17_*
  • Guests
If u are asking about the regular downloadind, then all u have to do is to right click and click on "Save Target As".

#3
Blaze

Blaze

    Programmer

  • Members
  • PipPipPipPip
  • 117 posts
I think he is asking how to download a file using PHP. I think you can just connect to the URL of the file and it will download. Not sure though.

#4
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
Yea, I'm wondering how to connect to a URL that is a file and actually save it on the server.

#5
Sionofdarkness

Sionofdarkness

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 384 posts
I'm as clueless as you. Well, 100x more clueless, actually. I didn't mean to equate us.

#6
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
i would think CURL would do the trick, but i dont know for sure. have you looked into that?

#7
Void

Void

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 411 posts
CURL should do the trick. You can also get other software that does this and just look at their code. I know a lot of PHP does this type of thing already for updates and such.
Void

#8
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts
How large of a file can you download using CURL? This seems like a neat function.

#9
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

Chan said:

How large of a file can you download using CURL? This seems like a neat function.

as large of a file as you want...curl is basically the equivilant of a text based browser

#10
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
Ok, so I've got this working now and I'd like to add a progress bar. Is there any way to do this?

#11
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
i dont believe there is anything native to php that can accomplish this task. Perhaps a message saying "Please wait while your file is downloading" and something animated, perhaps in flash can accomplish the overall feel of what you are trying to do, but as far as accomplishing this using php only, im pretty sure it cannot be done.

#12
Ronin

Ronin

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 309 posts
This sounds like an AJAX addon!