Rename file extension during a file upload ??

I need to rename the extension of a file at some point during the file upload. I am not sure where to do this at.
The file needs to be renamed before it is written to the directory.
Basically, the file will come in with a .txt or .doc type. Based on a users profile, I will change the type to a non-relavent number such as 1111.
Here is my upload servlet. Can you tell me where to change the type so it will write the file with the new extension?
Thanks.
public class FileExport {
//restrict upload files to 1 Meg
private static final int DEFAULT_MAX_POST_SIZE = 1024 * 1024;
private static final String NO_FILE = "unknown";
private HttpServletRequest req;
private File dir;
private int maxSize;
private Hashtable parameters = new Hashtable(); // name - Vector of values
private Hashtable files = new Hashtable(); // name - UploadedFile
public FileExport(HttpServletRequest request,
String saveDirectory) throws IOException {
this(request, saveDirectory, DEFAULT_MAX_POST_SIZE);
// request the servlet request
// saveDirectory = directory in which to save any uploaded files
// maxPostSize = maximum size of the POST content
public FileExport(HttpServletRequest request,
String saveDirectory,
int maxPostSize) throws IOException {
// check values
if (request == null)
throw new IllegalArgumentException("request cannot be null");
if (saveDirectory == null)
throw new IllegalArgumentException("saveDirectory cannot be null");
if (maxPostSize <= 0) {
throw new IllegalArgumentException("maxPostSize must be positive");
// Save the request, dir, and max size
req = request;
dir = new File(saveDirectory);
maxSize = maxPostSize;
// Check saveDirectory is truly a directory
if (!dir.isDirectory())
throw new IllegalArgumentException("Not a directory: " + saveDirectory);
// Check saveDirectory is writable
if (!dir.canWrite())
throw new IllegalArgumentException("Not writable: " + saveDirectory);
// Now parse the request saving data to "parameters" and "files";
// write the file contents to the saveDirectory
readRequest();
public FileExport(ServletRequest request,
String saveDirectory) throws IOException {
this((HttpServletRequest)request, saveDirectory);
public FileExport(ServletRequest request,
String saveDirectory,
int maxPostSize) throws IOException {
this((HttpServletRequest)request, saveDirectory, maxPostSize);
// Returns the names of all the parameters as an Enumeration of
// Strings. It returns an empty Enumeration if there are no parameters.
public Enumeration getParameterNames() {
return parameters.keys();
// Returns the names of all the uploaded files as an Enumeration of
// Strings. It returns an empty Enumeration if there are no uploaded
// files. Each file name is the name specified by the form, not by
// the user.
public Enumeration getFileNames() {
return files.keys();
// Returns the value of the named parameter as a String, or null if
// the parameter was not sent or was sent without a value.
public String getParameter(String name) {
try {
Vector values = (Vector)parameters.get(name);
if (values == null || values.size() == 0) {
return null;
String value = (String)values.elementAt(values.size() - 1);
return value;
catch (Exception e) {
return null;
// Returns the values of the named parameter as a String array, or null if
// the parameter was not sent.
public String[] getParameterValues(String name) {
try {
Vector values = (Vector)parameters.get(name);
if (values == null || values.size() == 0) {
return null;
String[] valuesArray = new String[values.size()];
values.copyInto(valuesArray);
return valuesArray;
catch (Exception e) {
return null;
// Returns the filesystem name of the specified file, or null if the
// file was not included in the upload. A filesystem name is the name
// specified by the user. It is also the name under which the file is
// actually saved.
public String getFilesystemName(String name) {
try {
UploadedFile file = (UploadedFile)files.get(name);
return file.getFilesystemName(); // may be null
catch (Exception e) {
return null;
// Returns the content type of the specified file (as supplied by the
//client browser), or null if the file was not included in the upload.
public String getContentType(String name) {
try {
UploadedFile file = (UploadedFile)files.get(name);
return file.getContentType(); // may be null
catch (Exception e) {
return null;
// Returns a File object for the specified file saved on the server's
// filesystem, or null if the file was not included in the upload.
public File getFile(String name) {
try {
UploadedFile file = (UploadedFile)files.get(name);
return file.getFile(); // may be null
catch (Exception e) {
return null;
// method that actually parses the request.
protected void readRequest() throws IOException {
// Check the content length to prevent denial of service attacks
int length = req.getContentLength();
if (length > maxSize) {
throw new IOException("Posted content length of " + length +
" exceeds limit of " + maxSize);
// Check the content type to make sure it's "multipart/form-data"
// Access header two ways to work around WebSphere oddities
String type = null;
String type1 = req.getHeader("Content-Type");
String type2 = req.getContentType();
// If one value is null, choose the other value
if (type1 == null && type2 != null) {
type = type2;
else if (type2 == null && type1 != null) {
type = type1;
// If neither value is null, choose the longer value
else if (type1 != null && type2 != null) {
type = (type1.length() > type2.length() ? type1 : type2);
if (type == null ||
!type.toLowerCase().startsWith("multipart/form-data")) {
throw new IOException("Posted content type isn't multipart/form-data");
// Get the boundary string; it's included in the content type.
// Should look something like "------------------------12012133613061"
String boundary = extractBoundary(type);
if (boundary == null) {
throw new IOException("Separation boundary was not specified");
// Construct the special input stream we'll read from
MultipartInputStreamHandler in =
new MultipartInputStreamHandler(req.getInputStream(), length);
// Read the first line, should be the first boundary
String line = in.readLine();
if (line == null) {
throw new IOException("Corrupt form data: premature ending");
// Verify that the line is the boundary
if (!line.startsWith(boundary)) {
throw new IOException("Corrupt form data: no leading boundary");
// Now that we're just beyond the first boundary, loop over each part
boolean done = false;
while (!done) {
done = readNextPart(in, boundary);
// A utility method that reads an individual part. Dispatches to
// readParameter() and readAndSaveFile() to do the actual work. A
// subclass can override this method for a better optimized or
// differently behaved implementation.
protected boolean readNextPart(MultipartInputStreamHandler in,
String boundary) throws IOException {
// Read the first line, should look like this:
// content-disposition: form-data; name="field1"; filename="file1.txt"
String line = in.readLine();
if (line == null) {
// No parts left, we're done
return true;
else if (line.length() == 0) {
// IE4 on Mac sends an empty line at the end; treat that as the end.
// Thanks to Daniel Lemire and Henri Tourigny for this fix.
return true;
// Parse the content-disposition line
String[] dispInfo = extractDispositionInfo(line);
String disposition = dispInfo[0];
String name = dispInfo[1];
String filename = dispInfo[2];
// Now onto the next line. This will either be empty
// or contain a Content-Type and then an empty line.
line = in.readLine();
if (line == null) {
// No parts left, we're done
return true;
// Get the content type, or null if none specified
String contentType = extractContentType(line);
if (contentType != null) {
// Eat the empty line
line = in.readLine();
if (line == null || line.length() > 0) {  // line should be empty
throw new
IOException("Malformed line after content type: " + line);
else {
// Assume a default content type
contentType = "application/octet-stream";
// Now, finally, we read the content (end after reading the boundary)
if (filename == null) {
// This is a parameter, add it to the vector of values
String value = readParameter(in, boundary);
if (value.equals("")) {
value = null; // treat empty strings like nulls
Vector existingValues = (Vector)parameters.get(name);
if (existingValues == null) {
existingValues = new Vector();
parameters.put(name, existingValues);
existingValues.addElement(value);
else {
// This is a file
readAndSaveFile(in, boundary, filename, contentType);
if (filename.equals(NO_FILE)) {
files.put(name, new UploadedFile(null, null, null));
else {
files.put(name,
new UploadedFile(dir.toString(), filename, contentType));
return false; // there's more to read
// A utility method that reads a single part of the multipart request
// that represents a parameter. A subclass can override this method
// for a better optimized or differently behaved implementation.
protected String readParameter(MultipartInputStreamHandler in,
String boundary) throws IOException {
StringBuffer sbuf = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
if (line.startsWith(boundary)) break;
sbuf.append(line + "\r\n"); // add the \r\n in case there are many lines
if (sbuf.length() == 0) {
return null; // nothing read
sbuf.setLength(sbuf.length() - 2); // cut off the last line's \r\n
return sbuf.toString(); // no URL decoding needed
// A utility method that reads a single part of the multipart request
// that represents a file, and saves the file to the given directory.
// A subclass can override this method for a better optimized or
// differently behaved implementation.
protected void readAndSaveFile(MultipartInputStreamHandler in,
String boundary,
String filename,
String contentType) throws IOException {
OutputStream out = null;
// A filename of NO_FILE means no file was sent, so just read to the
// next boundary and ignore the empty contents
if (filename.equals(NO_FILE)) {
out = new ByteArrayOutputStream(); // write to nowhere
// A MacBinary file goes through a decoder
else if (contentType.equals("application/x-macbinary")){
File f = new File(dir + File.separator + filename);
out = new MacBinaryDecoderOutputStream(
new BufferedOutputStream(
new FileOutputStream(f), 8 * 1024));
// A real file's contents are written to disk
else {
File f = new File(dir + File.separator + filename);
out = new BufferedOutputStream(new FileOutputStream(f), 8 * 1024);
byte[] bbuf = new byte[100 * 1024]; // 100K
int result;
String line;
// ServletInputStream.readLine()
// adds a \r\n to the end of the last line.
// Since we want a byte-for-byte transfer, we have to cut those chars.
boolean rnflag = false;
while ((result = in.readLine(bbuf, 0, bbuf.length)) != -1) {
// Check for boundary
if (result > 2 && bbuf[0] == '-' && bbuf[1] == '-') { // quick pre-check
line = new String(bbuf, 0, result, "ISO-8859-1");
if (line.startsWith(boundary)) break;
// Are we supposed to write \r\n for the last iteration?
if (rnflag) {
out.write('\r'); out.write('\n');
rnflag = false;
// Write the buffer, postpone any ending \r\n
if (result >= 2 &&
bbuf[result - 2] == '\r' &&
bbuf[result - 1] == '\n') {
out.write(bbuf, 0, result - 2); // skip the last 2 chars
rnflag = true; // make a note to write them on the next iteration
else {
out.write(bbuf, 0, result);
out.flush();
out.close();
// Extracts and returns the boundary token from a line.
private String extractBoundary(String line) {
// Use lastIndexOf() because IE 4.01 on Win98 has been known to send the
// "boundary=" string multiple times. Thanks to David Wall for this fix.
int index = line.lastIndexOf("boundary=");
if (index == -1) {
return null;
String boundary = line.substring(index + 9); // 9 for "boundary="
// The real boundary is always preceeded by an extra "--"
boundary = "--" + boundary;
return boundary;
// Extracts and returns disposition info from a line, as a String array
// with elements: disposition, name, filename. Throws an IOException
// if the line is malformatted.
private String[] extractDispositionInfo(String line) throws IOException {
// Return the line's data as an array: disposition, name, filename
String[] retval = new String[3];
// Convert the line to a lowercase string without the ending \r\n
// Keep the original line for error messages and for variable names.
String origline = line;
line = origline.toLowerCase();
// Get the content disposition, should be "form-data"
int start = line.indexOf("content-disposition: ");
int end = line.indexOf(";");
if (start == -1 || end == -1) {
throw new IOException("Content disposition corrupt: " + origline);
String disposition = line.substring(start + 21, end);
if (!disposition.equals("form-data")) {
throw new IOException("Invalid content disposition: " + disposition);
// Get the field name
start = line.indexOf("name=\"", end); // start at last semicolon
end = line.indexOf("\"", start + 7); // skip name=\"
if (start == -1 || end == -1) {
throw new IOException("Content disposition corrupt: " + origline);
String name = origline.substring(start + 6, end);
// Get the filename, if given
String filename = null;
start = line.indexOf("filename=\"", end + 2); // start after name
end = line.indexOf("\"", start + 10); // skip filename=\"
if (start != -1 && end != -1) {                // note the !=
filename = origline.substring(start + 10, end);
// The filename may contain a full path. Cut to just the filename.
int slash =
Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\'));
if (slash > -1) {
filename = filename.substring(slash + 1); // past last slash
if (filename.equals("")) filename = NO_FILE; // sanity check
// Return a String array: disposition, name, filename
retval[0] = disposition;
retval[1] = name;
retval[2] = filename;
return retval;
// Extracts and returns the content type from a line, or null if the
// line was empty. Throws an IOException if the line is malformatted.
private String extractContentType(String line) throws IOException {
String contentType = null;
// Convert the line to a lowercase string
String origline = line;
line = origline.toLowerCase();
// Get the content type, if any
if (line.startsWith("content-type")) {
int start = line.indexOf(" ");
if (start == -1) {
throw new IOException("Content type corrupt: " + origline);
contentType = line.substring(start + 1);
else if (line.length() != 0) {  // no content type, so should be empty
throw new IOException("Malformed line after disposition: " + origline);
return contentType;
// A class to hold information about an uploaded file.
class UploadedFile {
private String dir;
private String filename;
private String type;
UploadedFile(String dir, String filename, String type) {
this.dir = dir;
this.filename = filename;
this.type = type;
public String getContentType() {
return type;
public String getFilesystemName() {
return filename;
public File getFile() {
if (dir == null || filename == null) {
return null;
else {
return new File(dir + File.separator + filename);
// A class to aid in reading multipart/form-data from a ServletInputStream.
// It keeps track of how many bytes have been read and detects when the
// Content-Length limit has been reached.
class MultipartInputStreamHandler {
ServletInputStream in;
int totalExpected;
int totalRead = 0;
byte[] buf = new byte[8 * 1024];
public MultipartInputStreamHandler(ServletInputStream in,
int totalExpected) {
this.in = in;
this.totalExpected = totalExpected;
// Reads the next line of input. Returns null to indicate the end
// of stream.
public String readLine() throws IOException {
StringBuffer sbuf = new StringBuffer();
int result;
String line;
do {
result = this.readLine(buf, 0, buf.length); // this.readLine() does +=
if (result != -1) {
sbuf.append(new String(buf, 0, result, "ISO-8859-1"));
} while (result == buf.length); // loop only if the buffer was filled
if (sbuf.length() == 0) {
return null; // nothing read, must be at the end of stream
sbuf.setLength(sbuf.length() - 2); // cut off the trailing \r\n
return sbuf.toString();
// A pass-through to ServletInputStream.readLine() that keeps track
// of how many bytes have been read and stops reading when the
// Content-Length limit has been reached.
public int readLine(byte b[], int off, int len) throws IOException {
if (totalRead >= totalExpected) {
return -1;
else {
if (len > (totalExpected - totalRead)) {
len = totalExpected - totalRead; // keep from reading off end
int result = in.readLine(b, off, len);
if (result > 0) {
totalRead += result;
return result;
// Class to filters MacBinary files to normal files on the fly
// Optimized for speed more than readability
class MacBinaryDecoderOutputStream extends FilterOutputStream {
int bytesFiltered = 0;
int dataForkLength = 0;
public MacBinaryDecoderOutputStream(OutputStream out) {
super(out);
public void write(int b) throws IOException {
// Bytes 83 through 86 are a long representing the data fork length
// Check <= 86 first to short circuit early in the common case
if (bytesFiltered <= 86 && bytesFiltered >= 83) {
int leftShift = (86 - bytesFiltered) * 8;
dataForkLength = dataForkLength | (b & 0xff) << leftShift;
// Bytes 128 up to (128 + dataForkLength - 1) are the data fork
else if (bytesFiltered < (128 + dataForkLength) && bytesFiltered >= 128) {
out.write(b);
bytesFiltered++;
public void write(byte b[]) throws IOException {
write(b, 0, b.length);
public void write(byte b[], int off, int len) throws IOException {
// If the write is for content past the end of the data fork, ignore
if (bytesFiltered >= (128 + dataForkLength)) {
bytesFiltered += len;
// If the write is entirely within the data fork, write it directly
else if (bytesFiltered >= 128 &&
(bytesFiltered + len) <= (128 + dataForkLength)) {
out.write(b, off, len);
bytesFiltered += len;
// Otherwise, do the write a byte at a time to get the logic above
else {
for (int i = 0 ; i < len ; i++) {
write(b[off + i]);

I am also need to rename a file and extension while uploadinf the file to the server. The oreilly example seems only save as the same file name and ext. I wonder if you have the ability chANGE OIT OR NOT. pLEASE LET ME KNOW
thanks
kansen

Similar Messages

  • File Extension not allowed for upload

    Hi All,
    I'm trying to upload txt file but i got error message saying that "File Extension not allowed for upload".
    Can tell me where i can set the extension to allow txt, xls?
    Thanks a lot for the info,
    CW

    Hi there,
    There are quite some postings on this topic. Hopefully below thread can help you out.
    BPC- File extension not allowed for upload
    Starting point being the BPC AppSet parameters page:
    http://<servername>/osoft/Admin/SetParameters.aspx
    Rgds,
    Said

  • "Cannot open File Extension. Unknown file extension. Error code: 40003-5"

    Good Afternoon Everyone,
    I am getting an error message when the user is trying to access the link on their activity.
    "Cannot open File Extension. Unknown file extension. Error code: 40003-5"
    Can someone help?

    Please go to administration ->system initilization->general settings> path tab and define all the paths.
    i.e you must specify the path of each & every folder from where you are going to open the file.
    Hope your problem would be solved
    Regards,
    ShriX.

  • How to chop off file extensions from a file...

    How does one chop off the file extension of a file?
    In advance thanx!!

    I suggest you use "lastIndexOf" to get the last "." in case the file name has dots in it.
    Martin

  • CS5 requires file extensions to open files?

    I receieved some image files (jpegs) from a client. For whatever reason, they did not have any file extensions on the file name (no .jpg or .jpeg) They opened perfectly fine in Preview, but Photoshop just said:
    Could not complete your request because Photoshop does not recognize this type of file
    The funny thing is that, in the "Open..." dialog, Pshop displayed the preview image for the file.
    Once I added a .jpg to the filename, Photoshop opened it without a problem. I don't remember Pshop being so dependent on file extensions in the past. It's been a long time since I had to deal with extensionless files, though. Is this normal behavior?

    If the file type and extension don't match, there could be problems.  Photoshop goes with the file type first (as specified by MacOS guidelines).
    If the file has no type, and no extension - then Photoshop has nothing to go on.  Preview does a "best guess".
    (yes, Photoshop needs better guessing code, but it's not as easy as it sounds)

  • Marking a file extension during saving???

    Hi.
    The problem is, when a file is going to be saved, how can I do such a improvisation like a "save as" dialog?
    To avoid the "poor" technique of, user typing the extension, can do a something like a "save as" option in the JFileChooser saveDialog(), to offer a list of extensions and when user pick up one, to add it to the file name path, during file saving ?
    Thanks!

    Here is the solution I came up with. It will add the file extension if a FileExtensionFilter is selected, and you can set it to warn on write over
    * Created on May 17, 2005 by @author Tom Jacobs
    package tjacobs.ui.swing_ex;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.io.File;
    import javax.swing.JOptionPane;
    import javax.swing.filechooser.FileFilter;
    import javax.swing.filechooser.FileSystemView;
    import tjacobs.ui.FSFileView;
    import tjacobs.ui.fc.FileExtensionFilter;
    public class JFileChooser extends javax.swing.JFileChooser {
         private static final long serialVersionUID = 1L;
         private boolean mWarnOnWriteOver = false;
         private boolean mAncestorNull = false;
         public JFileChooser() {
              super();
              init();
         private void init() {
              setFileView(new FSFileView());
         public JFileChooser(String arg0) {
              super(arg0);
              init();
         public JFileChooser(File arg0) {
              super(arg0);
              init();
         public JFileChooser(FileSystemView arg0) {
              super(arg0);
              init();
         public JFileChooser(File arg0, FileSystemView arg1) {
              super(arg0, arg1);
              init();
         public JFileChooser(String arg0, FileSystemView arg1) {
              super(arg0, arg1);
              init();
         public boolean getWarnOnWriteOver() {
              return mWarnOnWriteOver;
         public void setWarnOnWriteOver(boolean b) {
              mWarnOnWriteOver = b;
              if (b) {
                   addPropertyChangeListener(new PropertyChangeListener() {
                        public void propertyChange(PropertyChangeEvent pe) {
                             //System.out.println("Here");
                             //System.out.println(pe.getPropertyName() + ": " + pe.getNewValue());
                             if (pe.getPropertyName().equals("ancestor") && pe.getNewValue() == null) {
                                  mAncestorNull = true;
                                  return;
                             mAncestorNull = false;
         public File getSelectedFile() {
              File f = super.getSelectedFile();
              if (f == null) return f;
              if (getDialogType() == javax.swing.JFileChooser.SAVE_DIALOG && f.getName().indexOf(".") == -1) {
                   //check if it's using file extension filter. If so, add the filter extension
                   FileFilter ff = getFileFilter();
                   if (ff instanceof FileExtensionFilter) {
                        String ending = ((FileExtensionFilter)ff).getType();
                        f = new File(f.getParent(), f.getName() + "." + ending);
              // now check if it's overwriting another file
              if (mWarnOnWriteOver && mAncestorNull) {
                   if (f.exists()) {
                        int ans = JOptionPane.showConfirmDialog(null, "" + f.getName() + " exists. Overwrite?", "Save Over Existing File", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
                        if (ans == JOptionPane.OK_OPTION)
                             return f;
                        return null;
              return f;
    }

  • "av" file extension added to files when FC Pro locks up during capture

    I just started having capture problems while using Final Cut Pro. I am capturing video using an AJA Kona LSe capture card. My scratch disk is my second internal hard drive (not the one with the operating system/applications). I have been capturing with this computer for a few months and now I'm getting this error about every other time I try to capture video. I read Stephen Lacey's post with the same problem, but I'm not getting any error messages like he was. Final Cut Pro appears to lock up. The ESC button doesn't stop the capture and I have to do a Force Quit to get out of Final Cut Pro.
    I would truly appreciate any help with this. Thanks!

    What is happening - when you first start capturing, the Mac OS is instructed by FCP to allocate disk space for the capture. If you have not set capture limits in the preferences, it allocates almost all the hard disk, and gives it a temporary file extension of .av. When the capture successfully completes, with the video recorded to some of that space, the system renames the space used by the video to the capture file name, typically filename.mov. It then frees up the unused space in the .av file.
    If you fail to complete the capture successfully, by force quitting FCP, the end cleanup never takes place, and the .av file remains filling up the disk. If you try the capture again, it will fail due to no free disk space. To recover, delete the .av file from the finder, and restart FCP. Better yet, reboot and restart FCP.

  • Change file extension in receiver file adapter

    File to File Scenario
    Posted: Sep 11, 2006 3:47 PM      Reply      E-mail this post 
    I am working on a File to File scenario.
    Source System gives out a file: abc ( with no extension)
    We need to archive it as: abc.done
    And we need to send it to a FTP server ( receiver File adapter) as abc.txt.
    How can I append a file extension when I archive and
    how can I change the file extension in the receiver File adapter?
    FYI, we are using XI as FTP server so I have created dummy message interface with no mapping.

    Hi,
    If I understood correctly once XI picks up the file it should be archieved as filename.doc and then it should be FTP'ed to a different location with a change in extension filename.txt.
    1. To Archive in the sender communication channel you can use OS Commands after prosessing (>=SP14) to rename the file and archive it. Suggested write a batch file which will rename the file and call the batch file from the OS Command of the sender file adapter. You can either use Archive functionaliy of the Sender adapter or you can write one more command in batch file to move the file to different folder. Make sure you are using fullpath while writing batch file.
    2. As said use dynamic configuration in a dummy mapping and then get the source file name and change the extension.
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Thanks,
    Prakash

  • Is there a quicker way to hide file extensions on multiple files.

    So, there's the real filename (visible in Terminal) and then the displayed name in Finder and some other applications such as Front Row. Well, I'm using Front Row and I would like my AVI files to display just the name of the movie - not the full filename.
    OS X allows me to change each file individually to hide the extension (either by renaming it in Finder or by checking 'hide extension' in the file's info box) and also allow the whole curtain to be pulled back via a setting in Finder's preferences. But there doesn't seem to be a way to hide the extensions of a particular bunch of files en masse.
    What I would like to know is: Is there a quicker way to do this for all my AVI files? There doesn't seem to be an Automator task that will change file properties (other than permissions). Is there a way I could do it at the command line perhaps? I'm fairly handy with Unix shell scripts and Perl - I'm just relatively new to OS X, that's all.

    The basic mechanism is to select all the files you wish to change then hold down the OPTION key and select Show Inspector from the Finder's File menu. Check the box to hide extension. This will set the preference for all selected files.
    If your files are scattered all over the place, then use the Finder's Find function to find all files with the extension attribute you want, then save the result as a Smart Folder. Then select all files in the Smart Folder you created and do the above.

  • Automatic appending of file extension of downloaded files

    Hello,
    When downloading files with certain extensions (.doc, .xls, .ppt, .tar.bz2), Safari will append an extension to the file after the download is finished (.dot, .xla, .pot, .tar).
    I don't know what exactly is the case of the problem, but I know this is a feature meant to correct the filename of downloaded files whose extension doesn't fit their MIME or UTI, or something along the line. For me, it is quite annoying since I download a lot of these files. It is annoying enough that I adopted Firefox as my main browser even if I prefer the sleek Safari design.
    Some posts on the web point out this problem for Microsoft's extension and propose a way to fix it (modifying office package), but I am looking for a way to disable the feature from Safari. Effectively, it causes only annoyance on my computer and it has never been proved useful. I expect the file on Internet to have the correct extension and I don't like Safari trying to outsmart it.
    Is there a way to disable the renaming feature?
    Thank you,
    Jonathan

    I'm having this issue with xml files renamed to .ychat.
    I noticed this after installing Yahoo! Messenger, therefore, there msut to be a way to undo this.
    It's getting annoying since I use to download many xml files from web pages.

  • Unwanted file extension inserted into file format list!

    I accidentally saved a .wav file with the .ses extension.  Now I've got the .ses extension included with .wav and .bwf extensions under the Save As Type box in my Save and Save As dialog windows.  Any advice on removing it?

    I just recreated your issue.  I saved a .wav file with the .ses extension at the end.  It did indeed put the .ses extension in with the .wav and .bwf extensions next to Windows PCM Wave File.
    I got rid of this by opening the affected file, doing a Save As, deleting the .ses extension from the file name when naming the file, then saving.  I closed the file, closed Audition, reopened Audition and the .ses extension was gone from the Windows PCM Wave File list.

  • BPC- File extension not allowed for upload

    I have read the other thread on this as I was having the same problem (not allowed to upload CSV files) - however now I can not upload any XLS files ! What have I done wrong ?
    I have added the following AppSet Parameters and values :
    ALLOW_EXTENSIONS       csv;XLS
    DEFAULT_EXTENSIONS    csv;XLS
    Thanks
    Si

    Hi Karen,
    I went to http://<servername>/osoft/Admin/SetParameters.aspx
    and added the following parameter values :
    ALLOW_EXTENSIONS
    DEFAULT_EXTENSIONS
    then gave it the values of :
    CSV,XLS,XML,TDM,CDM,XLT
    Hope this helps.
    Si

  • .prproj file extension missing in file association preferences Bridge

    I recently updated Bridge and lost my ability to open Premiere Pro projects from Bridge.  The prproj file would open in Media Encoder instead. I could however open the prproj file in Windows Explorer. The following is the fix to add prproj to file association option to Bridge.
    The Steps
    Navigate to C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Resources\Adobe Bridge Opener Preferences.xml
    Right Click on the file named Adobe Bride Open Preferences.xml , select "edit" from the fly out menu. The file will open in "Notepad"
    Expand the Notepad window, scroll to the bottom. Before the statement </openers> copy and paste the following statement.
    app_name="Premiere Pro">  
        <item description="$$$/Bridge/OpenersXML/Description/PremiereProject=Premiere Pro" extensions="prproj" app_name="OS">
         4. Now save the file to the desktop as Adobe Bridge Opener Preferences.xml and close.
         5. Navigate to C:\Program Files\Adobe\Adobe Bridge CC (64 Bit)\Resources
         6. Drag the file you saved to the the Bridge Resources folder.
         7. When prompted click "Move and Replace"
         8. Open Bridge and go to Edit> Preferences> File Type Associations
         9. Scroll to the bottom and you will see Premiere ( if you do not you may need to restore to default)
         10. Now you can add the correct File Association to the .prproj file.
    I am not sure if this is an isolated problem, but I thought that this information could help someone out there.

    thanks again... when you look at the directory tree in bridge i see...
    all of the folder and files where of jpeg and i could open and edit 
    here but they would not be edited in iphoto... once i updated to 
    ilife09 they became this...
    also if I go in thru the harddrive to get a picturefrom the pictures 
    folder that you see at the top it sends me here... i now have to 
    access the photo library by the way of the finder to the pictures 
    folder... any thoughts as to how to clean this up and would deleting 
    bridge help remove?
    russLAZAR
    [email protected]
    714-505-5441
    russLAZAR
    [email protected]
    714-505-5441

  • Mapping new file extension as JSP file in 6.1sp1

    How can I map .coolJsp as a JSP file in WLS6.1sp1? This seems to work,
              but is really ugly:
              web.xml:
              <servlet>
              <servlet-name>JSPServlet</servlet-name>
              <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
              <init-param>
              <param-name>compileCommand</param-name>
              <param-value>/bea/jdk131/bin/javac.exe</param-value>
              </init-param>
              <init-param>
              <param-name>workingDir</param-name>
              <param-value>.foo</param-value>
              </init-param>
              </servlet>
              <servlet-mapping>
              <servlet-name>JSPServlet</servlet-name>
              <url-pattern>*.coolJsp</url-pattern>
              </servlet-mapping>
              

    If you think that's ugly, you should see this one app where a guy mapped
              ".coolJsp" extension as if it were a ".jsp" ;-)
              Just kidding, but I am really curious what you are trying to do? Maybe there
              is an easier way? Are you just trying to use a different extension, because
              you could always map coolJsp to a router servlet that fw to the appropriate
              .jsp.
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "Tommi Reiman" <tommi_not_spam@nO_spam.soon.fi> wrote in message
              news:[email protected]..
              > How can I map .coolJsp as a JSP file in WLS6.1sp1? This seems to work,
              > but is really ugly:
              >
              > web.xml:
              > ########
              >
              > <servlet>
              > <servlet-name>JSPServlet</servlet-name>
              > <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
              > <init-param>
              > <param-name>compileCommand</param-name>
              > <param-value>/bea/jdk131/bin/javac.exe</param-value>
              > </init-param>
              > <init-param>
              > <param-name>workingDir</param-name>
              > <param-value>.foo</param-value>
              > </init-param>
              > </servlet>
              >
              > <servlet-mapping>
              > <servlet-name>JSPServlet</servlet-name>
              > <url-pattern>*.coolJsp</url-pattern>
              > </servlet-mapping>
              >
              >
              

  • Trying to find answers for the question "Why is this file type blocked from being uploaded into SharePoint"

    At least once a month - sometimes much more frequently - I get calls from users asking why the file extension they "need" to upload to SharePoint is blocked.
    Most recently, it was a Microsoft Access database that the user was attempting to upload to a document library. Before that, it was a shortcut link (*.url). And so on.
    Is there a reference document which goes over the reasons why specific file types are blocked?
    Thanks!

    Each blocked file format has it's own reasons for not being allowed to be stored on a SharePoint library.
    Some of them are blocked because they would be processed by SharePoint Servers during the upload/download sequences, thus, possibly corrupting the system ( like dll files ). Others would cause Crawl to break ( url files ).
    The Access database files are blocked for two valid reasons. First, because saving "live" to those files using Windows explorer window ( WebDAV ) doesn't work. Second because SharePoint product managers want us to use SharePoint lists instead.
    And it does makes sense.
    If you're in the middle of a migration from file servers to a SharePoint solution, your people could use these situations to stop and think about it for a little:
    Really ? Now that we have SharePoint, couldn't we do things a little bit differently ?

Maybe you are looking for

  • How do I view more pages in the Folio Builder ACV preview?

    I created a folio with an article that has two orientations, but when previewing it only shows the first page. How do I view more pages in the Folio Builder ACV preview?

  • Calculate price variance= goods transfer from consignment to own stock

    Hello network, i hope you can help me. We activated the business content (purchase data). The project is now on test stage. Now we want to calculate a price variance after the goods transfer from consignment stock to our own stock. Normally we compar

  • How to achieve this table in biee?

    !http://farm4.static.flickr.com/3443/3406243100_b60e73cfcc_m.jpg! as image show! How can I achieve this table in biee?I just know sum_level1 and sum_level2 can auto generate by biee,but what about rule1 and rule2,is there any way achieve them? Anyone

  • RSHIENODETMP Table getting to big

    Hi we are using BI7 found out that this table RSHIENODETMP is getting to big.. from the sap notes we know that repot RSAR_HIETMPTAB_CLEAN could be use, to delete some old data from it. The requirement of this program so it can be run, is using date t

  • Pre-Ordering a book, give price guarantee?

    I was thinking of Pre-ordering a book in the iBooks store. The price is kinda high, If i Pre-order it and the price comes down before release will I get that price? Or am I locked into the price that I originally Pre-ordered it at?