Jump to content


Photo

Download with php


  • Please log in to reply
12 replies to this topic

#1 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 11 September 2006 - 10:21 PM

hi guys, hope you are doing well!
I need your help with a php download script (I've googled it, but...), so I don't know from where to start. can u please give me a good tutorial or some reference to read? Thanks in advance.
I don't need your script, I'll try to write it myself

#2 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 September 2006 - 10:25 PM

So ummm what exactly do you mean?  Like a dynamic script that will hide a file's true location, or simply force a user to download something?
Why doesn't anyone ever say hi, hey, or whad up world?

#3 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 11 September 2006 - 10:27 PM

well actually, I want the script to download something when page loads, any ideas how can I start writing that?
I don't need your script, I'll try to write it myself

#4 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 September 2006 - 10:34 PM

Forgot exactly how to do it... It involves headers...
Why doesn't anyone ever say hi, hey, or whad up world?

#5 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 11 September 2006 - 10:36 PM

I am trying to use google but it displays the results where I can DOWNLOAD other things  :) Can't find php DOWNLOAD tutorial...
I don't need your script, I'll try to write it myself

#6 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 September 2006 - 10:42 PM

Hmm just found http://www.phpfreaks...ic,95433.0.html bout to read thru it now...
Why doesn't anyone ever say hi, hey, or whad up world?

#7 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 11 September 2006 - 10:44 PM

ok, thank u very much corbin, I'll try that. I've also found something on php.net :)
I don't need your script, I'll try to write it myself

#8 yong

yong
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 12 September 2006 - 01:54 AM

Gruzin ,can you write the url about what do you found..

#9 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 12 September 2006 - 08:30 AM

I've found not much info :(
Here is the URL http://ge.php.net/header
I don't need your script, I'll try to write it myself

#10 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 12 September 2006 - 08:38 AM

<?php

header('Content-disposition: attachment');
readfile('/path/to/file.txt');

?>
[/code]

#11 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 12 September 2006 - 08:50 AM

<?php

header('Content-disposition: attachment');
readfile('/path/to/file.txt');

?>
[/code]


I need something like this: when user clicks on a link, I want to download the file without promting the user. The example above asks user download or not the file... Thanks anyway. Still I have no idea how to do that, any suggestions will be greatly appreciated.
I don't need your script, I'll try to write it myself

#12 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 12 September 2006 - 08:51 AM

In a word - no. You cannot do that.

Just think of the security implications if web-devs could force the user to download whatever they want..

#13 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 12 September 2006 - 08:53 AM

ok, can I display the Alert in html code and not the browser Alert window? like when it asks save, open or cancel download? Thanks for your answers
I don't need your script, I'll try to write it myself




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users