"Wget 제공되는 파일명으로 다운로드"의 두 판 사이의 차이

18번째 줄: 18번째 줄:
2016-10-07 18:15:32 (1.94 MB/s) - ‘download1.php’ saved [12/12]
2016-10-07 18:15:32 (1.94 MB/s) - ‘download1.php’ saved [12/12]
</source>
</source>
* <code>--content-disposition</code> 옵션을 붙이면, 서버에서 제공하는 파일명인 <code>hello_world.txt</code>로 받아짐
* <code>--content-disposition</code> 옵션을 붙이면, 서버에서 제공하는 파일명([[Content-Disposition]])인 <code>hello_world.txt</code>로 받아짐
<source lang='console'>
<source lang='console'>
root@zetawiki:~# wget http://example.zetawiki.com/php/download1.php --content-disposition
root@zetawiki:~# wget http://example.zetawiki.com/php/download1.php --content-disposition

2016년 10월 7일 (금) 18:24 판

1 개요

wget 제공되는 파일명으로 다운로드
wget 파일명 헤더로부터 받기
wget --content-disposition 'URL주소'
wget 'URL주소' --content-disposition

2 실습

  • 그냥 wget 으로 받으면, URL 끝부분인 download1.php로 받아짐
root@zetawiki:~# wget http://example.zetawiki.com/php/download1.php
... (생략)
100%[=================================================>] 12          --.-K/s   in 0s      

2016-10-07 18:15:32 (1.94 MB/s) - ‘download1.php’ saved [12/12]
  • --content-disposition 옵션을 붙이면, 서버에서 제공하는 파일명(Content-Disposition)인 hello_world.txt로 받아짐
root@zetawiki:~# wget http://example.zetawiki.com/php/download1.php --content-disposition
... (생략)
100%[=================================================>] 12          --.-K/s   in 0s      

2016-10-07 18:15:38 (2.23 MB/s) - ‘hello_world.txt’ saved [12/12]

3 같이 보기

4 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}