Opened 10 years ago

Closed 10 years ago

#174 closed enhancement (fixed)

Don't load images and attached files when detecting content type in linkFromURL()

Reported by: dstillman Owned by: dstillman
Priority: minor Milestone: 1.0 Beta 2
Component: data layer Version: 1.0
Keywords: Cc: simon

Description

Setting the appropriate flags on the web browser object should do the trick (though I tried it briefly and couldn't get it to work...)

Change History (1)

comment:1 Changed 10 years ago by dstillman

  • Resolution set to fixed
  • Status changed from new to closed

(In [448]) Closes #173, Try to detect content type of linked pages without loading entire file
Closes #174, Don't load images and attached files when detecting content type in linkFromURL()

If mime type not provided, Scholar.Files.linkFromURL() now uses XMLHTTPRequest HEAD request to get the content type without loading file (thanks Simon for the idea)

If title not provided, try to figure it out from URL, though not particularly intelligently (last slash)

Note that order of title and mimeType parameters is now swapped

This code should be a bit smarter about unexpected conditions

Note: See TracTickets for help on using tickets.