+  HandyCache форум
|-+  Главная категория» English forum» Content-Type error
Имя пользователя:
Пароль:
Страниц: [1]   Вниз
  Отправить эту тему    Печать  
Автор Тема: Content-Type error  (Прочитано 2074 раз)
0 Пользователей и 1 Гость смотрят эту тему.
pankaj17939
Новичок
*

Репутация: +0/-0
Offline Offline

Сообщений: 43


« : 24 мая 2013, 15:29:03 »

I am filtering file by content and size
file in png 
http://lh4.googleusercontent.com/-q-oA6hx8VHQ/UZ9HQMu0T1I/AAAAAAADGHY/hldOlONJWTw/w506-h382-o/020-.png


Script  Start

 -- Check  for the Content-Type
function GetContentType(s)
  _,_,x = string.find(s, '[cC]ontent%-ype: *([^;\r\n]+)')
  if x~=nil then x = string.lower(x) end
  return x
end

-- Store Content-Type in variable
 type = GetContentType(hc.answer_header)

 -- Check 'Content-Type' is 'png' and storing it in variable png
 if type~=nil then png = string.find(type,'image/png',1,true)
  else png = nil end

Script end

the variable is always nill even if png file is browsed

Pls guide for the script

Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: