hi, everyone.
i code this to fetch something:
#fetch
try:
src_response = urlfetch.Fetch(self.url, self.request.body,
self.method,
headers, True, False)
except urlfetch.InvalidURLError, ex:
msg = "invalid url: %s" % self.url
logging.error(msg)
self.__error(400, msg)
return False
except urlfetch.DownloadError, ex:
msg = "download error: %s" % ex
logging.exception(msg)
self.__error(503, msg)
return False
as you see, i set "allow_truncated=True", when fetch some file large
than 1M(such as 12M), gae just give me 1M, but when i look at the
"Quota Details", the "Incoming bandwidth" had increase about 10M,
sometime it raise an Exception:
OverQuotaError: The API call urlfetch.Fetch() required more quota than
is available.
it means that gae count 12M "Incoming bandwidth" but just give me 1M
in fact, i cann't get the file size before fetch, so it's impossible
to set "range" header before fetch. i think gae shouldn't count the
true file size in "Incoming bandwith".
maybe someone will suggest me send a "HEAD" request before fetch, but
the content-type is unknown, i don't think it's a good solution.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.