[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]

rails:2458

From: Makoto Kobori <kbr2000@y...>
Date: Fri, 23 Nov 2007 00:59:30 +0900 (JST)
Subject: [rails:2458] ¥Ð¥¤¥Ê¥ê¤Î²èÁü¥Ç¡¼¥¿¤ò HTML ¾å¤Ëɽ¼¨¤¹¤ëÊýË¡

¤Ï¤¸¤á¤Þ¤·¤Æ¡£¤³¤Î¤¿¤Ó£Í£Ì¤Ë»²²Ã¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿
¾®Ë٤ȿ½¤·¤Þ¤¹¡£

²áµî¥í¥°¤Ë¤â¤¢¤ê¤Þ¤¹¤¬¡¢¥Ð¥¤¥Ê¥ê¤Î²èÁü¥Ç¡¼¥¿¤ò£È£Ô£Í£Ì¾å
¤Ëɽ¼¨¤µ¤»¤ëÊýË¡¤Ç¼ÁÌä¤Ç¤¹¡£

¶ñÂÎŪ¤Ë¤Ï
­¡¥¢¥Ã¥×¥í¡¼¥É²èÌ̤ǥ桼¥¶¤¬jpeg¤òupload¤¹¤ë¡£
­¢³Îǧ²èÌ̤ǥ¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿²èÁü¤ò³Îǧ
­££Ä£ÂÅÐÏ¿

¤È¤¤¤¦Î®¤ì¤òºî¤ê¤¿¤¤¤Î¤Ç¤¹¡£

¼ÂÁõ¤Ï
­¡ <%= file_field "file", "picture" %>
¤Ç¥Ó¥å¡¼¤òºî¤Ã¤Æ¥¢¥¯¥·¥ç¥ó¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£

­¢¸Æ¤Ó½Ð¤·¤¿¥¢¥¯¥·¥ç¥ó¤Ï°Ê²¼¡£session¤Ç²èÁü¤Î¥Ç¡¼¥¿¤ò
¡¡°ú¤­ÅϤ·¤Þ¤¹¡£
------------------------------------------
	@pic=params[:file]['picture']
	session[:pic1_name]=@pic.original_filename
	session[:pic1_ct] = @pic.content_type
	session[:pic1_data] = @pic.read
------------------------------------------

¤³¤Î¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥Ó¥å¡¼¤¬°Ê²¼
------------------------------------------
<h1>Upload#view</h1>

title:<%= @title %><br>

<%=image_tag(url_for(:action=> 'draw',:extension=>'.jpg'))
%>

------------------------------------------

url_for¤Ç¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¢¥¯¥·¥ç¥ódraw¤¬°Ê²¼¤Ç¤¹¡£

------------------------------------------
  send_data session[:pic1_data], 
            :filename => session[:pic1_name],
            :type => session[:pic1_ct],
            :disposition => 'inline'
------------------------------------------

¤³¤³¤Ç¼ÁÌä¤Ï¡¢²èÁü¤¬É½¼¨¤µ¤ì¤ë¤â¤Î¤Î¡¢session¤Ç
Ãͤò°ú¤­ÅϤ¹¤Î¤¬¡¢¶¯°ú¤Êµ¤¤¬¤·¤Æ¤Ê¤é¤Ê¤¤¤Î¤Ç¤¹¡£
¤â¤¦¾¯¤·¥¹¥Þ¡¼¥È¤Ê¤ä¤êÊý¤Ï¤Ê¤¤¤â¤Î¤Ç¤·¤ç¤¦¤«¡£

session¤Ç¡¢@pic¤Þ¤ë¤´¤È»ØÄꤷ¤¿¤é¡¢
¡ÖWe're sorry, but something went wrong.¡×
¤È½Ð¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£¹½Â¤ÂΤÏsession¤ÇÅϤ»¤Ê¤¤¡©
¼ÂÂÖ¤Ïcookie¤À¤«¤éÅϤ»¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤·¤ç¤¦¤«¡£

²¿¤«¤è¤¤¥¢¥É¥Ð¥¤¥¹¤¬¤´¤¶¤¤¤Þ¤·¤¿¤é¡¢¤´»ØƳ¤ª´ê¤¤¤·¤Þ¤¹¡£


--
ML: rails@r...
»È¤¤Êý: http://QuickML.com/

[Á°][¼¡][ÈÖ¹æ½ç°ìÍ÷][¥¹¥ì¥Ã¥É°ìÍ÷]