Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

figuring out extensions

Posted on 2014-03-20
8
220 Views
Last Modified: 2014-03-25
make a text file
compress it
rename it to .jpg
compress it again
 rename it to .jpg

it is not a .jpg, but will allowed to say so.

why did windows allow this? is it just a way to anonymize a file, if need be?

when you rename a extension, does it corrupt the file by any chance?

if the extension is renamed, is there any tool to extract the original extension in which it was created?
0
Comment
Question by:25112
8 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 144 total points
ID: 39942668
In general, extensions are just a convenience. They are functional in finding the correct application to open with file with if you double-click on one in Windows explorer. Changing the extension does not, by itself, change the file content.

It isn't clear why you would want to do such a series of actions
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 144 total points
ID: 39942675
The format of many file types can be determined or guessed at by looking at the contents, but there is no systematic way of doing so. If successful the original extension can be inferred.
0
 
LVL 34

Assisted Solution

by:Dan Craciun
Dan Craciun earned 71 total points
ID: 39942684
You could rename a jpg to png and the browsers and Windows Photo Viewer will still display it without problems, so I guess they test if the file has the right extension, and decide upon the header, kind of like in Linux.

Try to load a jpg renamed in png in Photoshop though, and all you'll get is an error.

My point is that it's the application's choice to trust that the extension is correct or not.

HTH,
Dan
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 14

Assisted Solution

by:Don Thomson
Don Thomson earned 71 total points
ID: 39942693
The only way to do it would be something like

Orig File   Text.txt
Compress it to Text.zip
Rename to Text.txt.jpg
Compress it to Text.txt.zip
rename it to Text.txt..zip.jpg
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 71 total points
ID: 39942703
The extension is pretty much just an indicator of what type of file it is and what program to use to open it with.
0
 
LVL 62

Assisted Solution

by:☠ MASQ ☠
☠ MASQ ☠ earned 71 total points
ID: 39942705
You can change a file extension to whatever you like, like changing the file name it has no effect on the content. However Windows has historically used file extensions to inform its Open With... command so most people will have an entry in their Windows registry that says if it ends with .jpg then treat it as a JPEG graphics format and open it with an appropriate program.  It's just a shorthand and makes the assumption that users will adopt a standard naming policy, as you describe it can be used to hide the true format of a file (sometimes maliciously).

The best way to get to the identify of a file is to look at the Hex signature in the file header though - if that's "FF D8 FF" then chances are whatever the file name and extension is it's probably a JPEG - some cleverer multimedia packages already look at the file header and will warn you if that and the file extension don't seem to be the same file type.

Although I said files aren't damaged simply by changing the file extension they can be harmed if they are then opened by the wrong program as a result.  Changing a .jpg extension to .txt and then opening and saving the file in a text editor rather than graphics program as a result might well convert the data from something like Unicode to ANSII rendering it useless if the file extension is changed back to its original setting.
0
 
LVL 48

Accepted Solution

by:
dbrunton earned 72 total points
ID: 39943226
>>  if the extension is renamed, is there any tool to extract the original extension in which it was created?

There are utils to determine what the file content is and thus the correct extension.

Examples:

Trid

Other Tools
0
 
LVL 5

Author Comment

by:25112
ID: 39954895
thanks- it helped me out
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question