Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > .zip files and .rar files?

Reply
Thread Tools

.zip files and .rar files?

 
 
fj
Guest
Posts: n/a
 
      12-03-2006
Hi,

Can anybody tell me why I can link to .zip files on my website but not to
..rar files? And how can I link to .rar files?

Thanks, flip


 
Reply With Quote
 
 
 
 
Ed Seedhouse
Guest
Posts: n/a
 
      12-03-2006
On Sun, 03 Dec 2006 20:54:18 GMT, "fj" <(E-Mail Removed)>
wrote:

>Hi,
>
>Can anybody tell me why I can link to .zip files on my website but not to
>.rar files? And how can I link to .rar files?


You can link to any file you want. The browser can't display it
however, unless it knows about the files type and what application to
call up for the purpose. Most people don't have .rar viewers so they
won't be able to do anything with the link except download it.

 
Reply With Quote
 
 
 
 
fj
Guest
Posts: n/a
 
      12-04-2006
Hi,

I also tried to link to .exe files but it will not download those files
either. I've downloaded .exe and .rar files from other sites. The .rar files
just show as garbled computer language (I think).

flip

"Ed Seedhouse" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sun, 03 Dec 2006 20:54:18 GMT, "fj" <(E-Mail Removed)>
> wrote:
>
>>Hi,
>>
>>Can anybody tell me why I can link to .zip files on my website but not to
>>.rar files? And how can I link to .rar files?

>
> You can link to any file you want. The browser can't display it
> however, unless it knows about the files type and what application to
> call up for the purpose. Most people don't have .rar viewers so they
> won't be able to do anything with the link except download it.
>
>



 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      12-04-2006

fj wrote:
> I also tried to link to .exe files but it will not download those files
> either. I've downloaded .exe and .rar files from other sites. The .rar files
> just show as garbled computer language (I think).


Then it has linked to the file, but not managed to serve it correctly.

As a guess (as a I don't know which site you're talking about) then the
page linking to these files is correct. The server where these files
are located is incorrect and badly configured.

Many servers assume that all the files on them are either "HTML" or
"plaintext", unless they're specific sorts of file (like JPG) that it
knows about. The "type" of files can be guessed from the file extension
in their name, but that's not how the web protocols work. Instead they
have a particular header of "content-type" such as "text/plain",
"text/html", "image/jpeg" or "application/octet-stream".
"application/octet-stream" means "We have no idea what this is, just
treat it as raw data and store it, but don't try to view it, run it or
do anything clever with it"

A well-run server should serve file types that it understands
correctly. It will also need a fallback or default for those it doesn't
understand, and that should be "application/octet-stream". If the
server admins want an easy life and no support calls from people
inventing crazy new file extensions, then the temptation is to set the
default up as "text/plain" (or even worse, "text/html") and then let it
serve everything unknown as if it's a viewable text document.

It looks like the server here understands ZIP files and serves them
correctly, but it doesn't know about RAR files and so lets them default
to text/plain. Your browser then sees this (as instructed) as a
viewable text file and tries to view it.

If you have to link to such a file and download it, then one quick hack
is to find a link to it, then instead of following that link and trying
to save it, instead don't follow the link but just use your browser's
"Save link as..." feature (try the right-mouse menu).

 
Reply With Quote
 
fj
Guest
Posts: n/a
 
      12-04-2006
Thanks,

flip

"Andy Dingley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>
> fj wrote:
>> I also tried to link to .exe files but it will not download those files
>> either. I've downloaded .exe and .rar files from other sites. The .rar
>> files
>> just show as garbled computer language (I think).

>
> Then it has linked to the file, but not managed to serve it correctly.
>
> As a guess (as a I don't know which site you're talking about) then the
> page linking to these files is correct. The server where these files
> are located is incorrect and badly configured.
>
> Many servers assume that all the files on them are either "HTML" or
> "plaintext", unless they're specific sorts of file (like JPG) that it
> knows about. The "type" of files can be guessed from the file extension
> in their name, but that's not how the web protocols work. Instead they
> have a particular header of "content-type" such as "text/plain",
> "text/html", "image/jpeg" or "application/octet-stream".
> "application/octet-stream" means "We have no idea what this is, just
> treat it as raw data and store it, but don't try to view it, run it or
> do anything clever with it"
>
> A well-run server should serve file types that it understands
> correctly. It will also need a fallback or default for those it doesn't
> understand, and that should be "application/octet-stream". If the
> server admins want an easy life and no support calls from people
> inventing crazy new file extensions, then the temptation is to set the
> default up as "text/plain" (or even worse, "text/html") and then let it
> serve everything unknown as if it's a viewable text document.
>
> It looks like the server here understands ZIP files and serves them
> correctly, but it doesn't know about RAR files and so lets them default
> to text/plain. Your browser then sees this (as instructed) as a
> viewable text file and tries to view it.
>
> If you have to link to such a file and download it, then one quick hack
> is to find a link to it, then instead of following that link and trying
> to save it, instead don't follow the link but just use your browser's
> "Save link as..." feature (try the right-mouse menu).
>
>



 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      12-04-2006
Andy Dingley wrote:
> fj wrote:
>> I also tried to link to .exe files but it will not download those files
>> either. I've downloaded .exe and .rar files from other sites. The .rar files
>> just show as garbled computer language (I think).

>
> Then it has linked to the file, but not managed to serve it correctly.
>
> As a guess (as a I don't know which site you're talking about) then the
> page linking to these files is correct. The server where these files
> are located is incorrect and badly configured.
>
> Many servers assume that all the files on them are either "HTML" or
> "plaintext", unless they're specific sorts of file (like JPG) that it
> knows about. The "type" of files can be guessed from the file extension
> in their name, but that's not how the web protocols work. Instead they
> have a particular header of "content-type" such as "text/plain",
> "text/html", "image/jpeg" or "application/octet-stream".
> "application/octet-stream" means "We have no idea what this is, just
> treat it as raw data and store it, but don't try to view it, run it or
> do anything clever with it"
>


Aside of adding the mime type via an .htaccess file could he not simply
add the TYPE attribute to his link?

<a href="someRarFile.rar" type="application/x-rar-compressed">The RAR
File</a>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      12-04-2006

Jonathan N. Little wrote:

> Aside of adding the mime type via an .htaccess file could he not simply
> add the TYPE attribute to his link?
>
> <a href="someRarFile.rar" type="application/x-rar-compressed">The RAR
> File</a>


This rather depends on how much you admin. If you control the link page
but not the storage, then this is indeed a useful approach.

If you control the server that serves the actual content though, you
should fix it up (maybe through .htaccess) so that the content is
served correctly, no matter how the user gets to that URL or which link
(if any) they followed.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      12-04-2006
Andy Dingley wrote:

> If you control the server that serves the actual content though, you
> should fix it up (maybe through .htaccess) so that the content is
> served correctly, no matter how the user gets to that URL or which link
> (if any) they followed.
>


I offered this because some to not have access to .htaccess.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      12-05-2006
Jonathan N. Little wrote:

> <a href="someRarFile.rar" type="application/x-rar-compressed">The RAR
> File</a>


Correct me if I'm wrong, but isn't this considered "advisory" -- i.e. once
the link has been followed, the real HTTP header over-rides it?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      12-05-2006
Toby Inkster wrote:
> Jonathan N. Little wrote:
>
>> <a href="someRarFile.rar" type="application/x-rar-compressed">The RAR
>> File</a>

>
> Correct me if I'm wrong, but isn't this considered "advisory" -- i.e. once
> the link has been followed, the real HTTP header over-rides it?
>



Not sure, have to do further research, however it does seem to work in
tests....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check what symbols are defined in a .o files? .a files? and.so files in linux? yinglcs@gmail.com C++ 3 01-18-2009 05:23 PM
somebody know why every time what published it changes the namedlls and aspx files has link to its files. Alejandro Pombo ASP .Net 0 01-25-2006 01:54 PM
how i can extract text from the PDF files,power point files,Ms word files? crazyprakash Java 4 10-30-2005 10:17 AM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
Help! Files, Files, and more Files ... Everywhere JeffS Digital Photography 22 09-19-2004 01:47 AM



Advertisments