Amazon sitemap data in xml.gz form uncompressable - amazon

this might be a very dumb question but.. I'm trying to get the amazon sitemap and I have looked at amazon.com/robots.txt. They have a few .xml.gz files for their sitemap which I have downloaded. The problem that I'm having is that I cannot unzip them. I feel like I'm missing something very obvious.
For example, one sitemap is: http://www.amazon.com/sitemaps.f3053414d236e84.SitemapIndex_0.xml.gz
Thanks!

This is happening because Content-Type is set to binary/octet-stream in the response. If you override Content-Type response header to text/xml,
browser will automatically decompress the file.

I just renamed the *.xml.gz to *.xml and open it in a text editor and just worked.
I don't know if it was a problem with the browser or the file is corrrupted.

Related

.htacces folder name with same file name?

I have a file in my webpage called news.
I did not write .html the end of the file, is this still correct? (the browser shows like html)
I want to make a folder in my server with the same name and put the articles there.
For example:
www.example.com/news ->>> this shows the main news page
www.example.com/news/article0101 --> this shows the article
If a user type www.example.com/news or www.example.com/news/ both must show the main news page.
In my webserver, I made all files without any extension.
I have read previous Q/A -s from this page and other pages and I have did not found a valid soulution to my problem?
Can I even modify the .htacces file in this way? Or I approach the problem in the wrong way?
Do I require a database or I just need files if I want to write articles?
Where can I find standard documentation for a webpage with articles and news?
Thanks very much your help

Forcing IE to download NOT open files

We have a simple html page with a list of links on a Tomcat server. Many of the links are just a simple .msg file for users to download, fill-in and send. Works great in Chrome but not in IE. IE tries to load the .msg file and all you see is 'garbally gook'.
I've tried searching for answers but none have worked so far.
Tried:
- Adding 'download' to the tag but of course this isn't supported in IE.
- Tried adding a .htaccess file with: AddType application/octet-stream .msg, but this didn't work either.
Tomcat is by Apache so I'm really surprised the .htaccess file answer didn't work. Some answers suggested using PHP or adjusting config files, but this is a little over my head. Who would have thought such a seemingly simple question would be so technical to fix!
Many thanks for any direction you are able to suggest!
I finally found my answer so for the next none techy, hopefully this will help you too!
For Apache Tomcat, find your web.xml and open in Note Pad. Search for MIME, you want to keep going until you find your MIME types, they will look like the below code. They are sorted alphabetically so place your new MIME type accordingly. For me it was a .msg file that I wanted IE to prompt an open/save as, rather than just trying to opening it.
<mime-mapping>
<extension>msg</extension>
<mime-type>application/vnd.ms-outlook</mime-type>
</mime-mapping>
To find the appropriate MIME type, I just did a Google search for 'Outlook .msg MIME Type' and found it pretty quickly. After you have added your new MIME Type save and restart your server.
Issue: web.xml wouldn't let us save over it. We got around this by saving our new file with a different name, rename/delete the existing web.xml file and then renaming the updated file back to web.xml.
Issue: After restarting the server, IE STILL tried to read the .msg file rather than opening it, even after refreshing cache, grrrr! Trying another link we hadn't tried before, revealed the new MIME Type to be working and testing on another computer confirmed it.
Good luck!

How to link to local images on Node.js version of Tiddlywiki?

I'm using the Node.js version of TiddlyWiki, and I'd like to link to images on my filesystem.
The documentation listed here doesn't work; in the [img[path]] tag, for the path part I put something like /Users/documents/ken/path_to_image.jpg yet nothing shows up in the tiddler.
My wiki exists in /Users/documents/ken/wiki.
I know this is an old post, but zacts stated that you can use a macro plugin or simply use the [img] tag to point to the relative path of the image from the tiddlywiki.html file, but the op is using the node.js version, and zacts apparently didn't read that. There is no tiddlywiki.html file for TiddlyWiki on node.js. That only works with the static .html version of tiddlywiki, not the node.js version.
Currently there is no way to point to a local file through the node.js version of Tiddlywiki as node.js is not a webserver, therefore it does not see subfolders like /images/ off of the root url. The only way is to run a parallel web server on the same machine and use the full web url to the images served up from the web server.
In case someone else stumbles across this problem:
I could not find this documented anywhere, but what seems to work is to just copy the image in the tiddlers directory, then restart the nodejs server, and search for the image title from tiddlywiki. There will be a tiddler that contains that image, that you can edit at your leisure.
Alternatively, copy the image as image_name.png (or image_name.jpg) into the tiddlers directory, and create a image_name.png.meta text file with the following contents:
title: image_name
type: image/jpeg
Upon restart of the tiddlywiki nodejs server, a tiddler with title image_name which contains the image will be there.
If you are using the Node.js version, you can simply put it in the ./files folder, and then use [img[. /files/xxx.jpg]] to reference it.
I had this same issue recently, and I found a neat little solution for it. Let me send you the links, and I'll post the snippets here.
I happened to stumble across this tiddlywiki image gallery homepage that linked to a macro plugin that lets you link in local images. Here is the link to the tiddler for the plugin: http://www.richshumaker.com/tw5/tw-photo.html#External%20Image%20Path. Here is the original TiddlyWiki google groups post of the plugin for this: https://groups.google.com/forum/#!msg/tiddlywiki/ChRV6sjQpn4/bCm35_XhGmkJ.
I hope this helps! =) (note: when I get more time I may clean up the formatting of this post).
It is very simple, you use _canonical_uri field
_canonical_uri field
The field value is something like "./wiki/path_to_image.jpg" (mine is "./files") in the same level as the tiddlers folder. I did not experimented with files outside the root folder of the wiki. The dot in the path might be ommited.
The content type might be "audio/mp3" "image/jpg" look at the "parser" shadow tiddlers. Your Browser might support more content types like "audio/wav" but you would have to add this line to "$:/core/modules/parsers/audioparser.js" For example. Might be the same thing for images. Check your browser support.
I really do not know why this fact is so obscure, but it work wonders.

html to excel problem!

I am printing excel like this:
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-type: application/x-msexcel; charset=utf-8");
header("Content-Disposition: attachment; filename=".str_replace(' ', '_', $title).".xls");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
The content is plain html. The problem, when I download this, I get an initial confirmation box written
The file you are trying to open 'File_name.xls', is in a different format than specified by the file extension. Verified that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
When I do 'yes', I get this. Bit strange, any input here friends please ?
Well, that is pretty strange. I doubt this will help, but try renaming it to .xlsx. It might just be that it's not getting the proper (newer) file extension.
I always use content type = "application/ms-excel"
I have an application that does the same thing; it sets ContentType = "application/vnd.xls" and it works correctly (you still get the warning about that it's in the wrong format, but it opens after that).
I suspect the problem is not the content type, but the actual html content you are sending. Can you post an example of the file you are sending that causes the error?
Well, this one suddenly got solved, I don't know how.
This is what I did. I copied and pasted codes of a different page where the excel thing was working. Then, I changed the variables manually to adapt this with the 2nd page.
After some hit and try, it suddenly worked.
Thanks for all the answers anyway.
PS. By solved, I mean that excel is not crushing anymore, though I am still getting the confirm box about incorrect format.

Site Error File Does Not Exist

I used http://site-perf.com/ to test the speed of my site (http://sweatingthebigstuff.com) and it shows one file that gives a 404 error. That file does not exist (hence the error), but how do I found out how to fix it? I don't know where it is being called (definitely not in the code).
The file in question is:
sweatingthebigstuff.com/wp-content/themes/WillTech_5_3_2010/lib/images/icon-rss.gif
I assume that I used to have a file but since deleted it. It was in a widget and it is now pointing to a png file.
Any ideas?
It was in a widget and it is now pointing to a png file.
There is a reference to it somewhere - in a forgotten HTML file, in a style sheet.... The easiest might be doing a full-text search for your whole (local) Wordpress directory for icon-rss.gif.
If that doesn't turn up anything - it should, though! - try using a downloader like GetLeft to fetch a full HTML copy of your site, and do a full text search on that. That should at least show you which page the offending line is on.

Resources