Invalid Mimetype Detection for .xls file with CF10

After upgrading to CF10, we are having issues getting our server to properly recognize any mimetype associated with the .xls file extension.  For some odd reason, the server is viewing them as a word file type and rejecting it.   
When we upload a file with the .xls extension, the server responds back with the following error message:
"The MIME type or the Extension of the uploaded file application/msword was not accepted by the server. Only files of type application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,appl ication/vnd.openxmlformats-officedocument.spreadsheetml.sheet can be uploaded. Verify that you are uploading a file of the appropriate type. The error type is Application."
Our only workaround for the time being is uploading all files in the newer .xlsx format, which the server properly accepts.  As you will see from the above error message, those are the mimetypes I have thus far.  The other work around is updating the tika jar files which I have included more details in my bug report link below, but that is a solution we are steering off of until we get further confirmation on the solution. 
I've reported this possible bug to Adobe, but of course it will be weeks or months before a confirmation or response is made on it since there are countless other bugs / feature requests that are still unanswered.  So I'm reaching out to the community in efforts to see if anyone else may have received the same issue or could see what we may be doing wrong. 
Link to bug report with more details: https://bugbase.adobe.com/index.cfm?event=bug&id=3343364

If you guys want to replicate this in your local environment, it's very easy using the steps I outlined in my bug report.  Please report back on your results.  I would love to see if other users experience the same or different.
Steps to Reproduce:
1. Create cfset tags to specify what type of files and mime types are allowed for user uploads.
<cfset uploadFileFilter = ".xls,.xlsx" />
<cfset uploadFileMimeType = "application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,app lication/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
2. Define where the file will be uploaded to using the cffile attribute. (Change destination to the same directory of where you are creating the current .cfm file below)
<cffile action = "upload"
fileField = "fileupload"
destination = "C:\test\"
accept = "#uploadFileMimeType#"
nameConflict = "MakeUnique">
3. Finally create a simple form that allows the user to upload files.
<cfform enctype="multipart/form-data">
<cfinput accept="#uploadFileMimeType#" type="file" name="FileContents">
<br/>
<cfinput type="submit" name="submit" value="Upload File">
</cfform>
4. Open excel, enter any data, and save it as an .xls file.
5. Submit it to the form.
Final code
<cfset uploadFileFilter = ".xls,.xlsx" />
<cfset uploadFileMimeType = "application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,app lication/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<cfif isDefined("Form.FileContents") >
    <cffile action = "upload" 
        fileField = "FileContents" 
        destination = "C:\EnterLocalPathHere\" 
        accept = "#uploadFileMimeType#" 
        nameConflict = "MakeUnique">
<cfelse>
    <cfform enctype="multipart/form-data">
        <cfinput accept="#uploadFileMimeType#" type="file" name="FileContents">
        <br/>
        <cfinput type="submit" name="submit" value="Upload File"> 
    </cfform>
</cfif>

Similar Messages

  • Directory for archiving files with errors

    HI ,
    My Scenario is file to RFC Asynch.
    when ever the PI picks file from the source directory that file need to delete from the path and need to be archived to some other patch.
    And if the file has wrong data it need to archive to error archive folder.
    For this I used  Archive processing in filesender adapter and I also used directory for archiving files with errors(for wrong data files).
    Now the files are arching successfully in the given archive folder for successful messages. But the error files (wrong data which are throwing mapping error in MONI) are also archiving in the same archive folder.
    But these error files need to archive in error archive folder.
    How can I achieve this?
    Thanks in Adv..
    Vankadoath.

    you can use raja's logic ..........in addition in second receiver do a simple mapping UDF to delete the file from the SUCCESS folder. otherwise your file will be archived in both the folder success and errror
    see this code.
    DynamicConfiguration conf = (DynamicConfiguration) para.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey keyFileName1 = DynamicConfigurationKey
                   .create("http://sap.com/xi/XI/System/File", "FileName");
                         inputFileName = conf.get(keyFileName1);
      *File f1 = new File("/usr/sap/XX/"+keyFileName1);*
      *boolean success = f1.delete();*
      *if (!success){*
      *System.out.println("Deletion failed.");*
      *System.exit(0);*
      *}else{*
      *System.out.println("File deleted.");*

  • Search for a file with part of a filename in a given folder.

    How can I search for a file with part of a filename in a given folder?
    Or can I change the columns in Advanced Search so that the heading is filename?

    thanks, Michel. it had occurred to me to put a scratch tag on the folder, but I was hoping for an easier way. in future I'll do as you suggest though, because it's easier than what I have been doing.
    daryl

  • Downloading .xls file with multiple rows and Columns

    Hi ALL,
    I need to genarate .xls file with multiple rows and and Columns and sent as an email.Since our customer having Problem with .CSV files need to genarate .XLS file.
    Please do the needful.
    Thanks
    Madhu

    Hi Madhu,
    You might also consider using Excel Spreadsheet XML as the target structure (namespace is urn:schemas-microsoft-com:office:spreadsheet).  When you double-click the resulting xml on a PC it automatically opens with Excel. So, users don't see a difference.  It will open up a lot of options with formatting including creating multiple worksheets if you wanted to.  Best of all you can stick with XML.
    See my response in this thread:
    Re: Convert XML data into XLS 
    Thanks,
    -Russ

  • XLS file with password protected

    Hi,
               I have a requirement to create a XLS file with password protected (Data from internal table) and send the same through mail. Can any one help me how to deal this through abap code?
    BR,
    Praveen.

    Hi Praveen,
    With OLE it is possible. Refer [Excel with Password|OLE2 Excel File Save as password protected;
    I am not sure if you can set the password and send it directly.
    Regards
    Rajvansh

  • "Cannot interpret data in file" error while using GUI_UPLOAD for .xls file

    Hi,
         I have made a program using FM GUI_UPLOAD to upload an .xls file to an internal table. But upon executing ,it gives error "Cannot Interpret data in file". I have seen in other posts people talking about GUI_UPLOAD FM to upload data from excel directly into internal table. Kindly help.
    Here is my code. I had tried using different combination for HAS_FIELD_SEPARATOR but still its not working.
    In my emp1.xls file , the data in each column is present in the same order as in the internal table. Although the first column in my internal table is NUMC. I dont know if that is causing the problem.
    REPORT  ZUPLOAD_1.
    data: itab TYPE TABLE OF zempl_master WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\empl1.xls'
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = itab.
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   NO_AUTHORITY                  = 6
    *   UNKNOWN_ERROR                 = 7
    *   BAD_DATA_FORMAT               = 8
    *   HEADER_NOT_ALLOWED            = 9
    *   SEPARATOR_NOT_ALLOWED         = 10
    *   HEADER_TOO_LONG               = 11
    *   UNKNOWN_DP_ERROR              = 12
    *   ACCESS_DENIED                 = 13
    *   DP_OUT_OF_MEMORY              = 14
    *   DISK_FULL                     = 15
    *   DP_TIMEOUT                    = 16
    *   OTHERS                        = 17
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP at itab.
      write:/ itab-emp_no,itab-name.
    endloop.

    hi amber22 you need to use the below fm to upload an xls file
    FORM EXCEL_UPLOAD .
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = FILENAM
          I_BEGIN_COL = 1
          I_BEGIN_ROW = 1
          I_END_COL   = 6
          I_END_ROW   = 100
        TABLES
          INTERN      = xl_itab.
    * EXCEPTIONS
    * INCONSISTENT_PARAMETERS = 1
    * UPLOAD_OLE = 2
    * OTHERS = 3 .
      IF SY-SUBRC = 0.
    MESSAGE 'DATA UPLOADED SUCCESSFULLY' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " EXCEL_UPLOAD

  • How to write heading in the xls file with each of the channel in each column?

    Dear All,
    While writing the data into the xls file through .lvm method I want the Headong for each channel to be include on each of the column, but i dint know how to do this? is this possible in the LabVIEW from any of the file writing method? if yes how can i do that? please help me.........
    Thanks,
    Nishant Desai

    Thanks Chilly,
    Its a really fantastic idea, and it works for me too, but the thing inside was every time once it writes the heading and then it write the data again after that it wirtes the heading and write the data, but i ve copup with dat and i ve modified the vi which u ve given to me, i am attaching that vi to with this.
    wat i ve done is just putting the write to spreadsheet data vi into the while loop and other all are outside the while loop, which makes the heading to write once and data to write continuosly.
    Thanks & Regards,
    Nishant Desai
    Attachments:
    Write channel names_yours.vi ‏25 KB
    Write channel names_mine.vi ‏31 KB

  • Delimiter for  .xls file in lsmw

    Hi, I am developing an lsmw..and the flat file is in the form of .xls file..so when sepcifying hte file it asks for the delimiter.what should  i give for delimiter if my flat file is a .xls file?
    i would reward points for the helpful answers.

    If you see your XLS file in notepad/wordpad, you can see there is nothing like u have written in ur XLS sheet. U will see file with special characters.
    So I think that's the reason you can not use FM : GUI_UPLOAD for uploading file from PC to SAP.
    You have to use FM : TEXT_CONVERT_XLS_TO_SAP.
    In LSMW, this FM is not used.
    So you have to save contents of ur XLS sheet to a text file then you 'll be able to do ur normal operation.
    Regards
    Prax

  • Applet failed to open xls file with Firefox and Office 2010 installed (o.s: Windows 7). It works with Office 2007.

    I load a signed applet in a web application.
    The applet open a xls file when I press the finalize button.
    It works correctly in Firefox, IE, Chrome and Safari. I have installed Office 2007.
    But when I test it in a new pc with Office 2010 installed, it does not work in Firefox browser (it works in IE, Chrome and Safari)
    This is the console java error:
    java.io.FileNotFoundException: my_file.xls (Access is denied)
    The plugin for Microsoft Office 2010 is installed.
    Java Plug-in is 1.6.0_27.
    Firefox version: 3.6 and latest version: 7
    O.S.: Windows 7
    I search in Bugzilla but not found anything about this.
    I test it with Firefox Beta - Aurora and the behaviour is the same.
    Is there any bug for Office 2010 in Mozilla Firefox?
    Any suggestion?

    Rectify the post:
    It works with Firefox 3.6, but it does not work with Firefox 7.
    Is there any bug in Firefox 7 with excel?

  • Opening .xls file with Numbers

    I saved a spreadsheet from Numbers '09 version 2.0 in .xls format and then tried to open it, but Numbers won't open it because off a reported problem with the plug-in to do that, "SFCompatibility plug-in." This used to work, I think. Perhaps the latest operating system update messed it up. (I have OS X 10.8.5.) Software update says there is no update for any of my apps. My Numbers software is in Applications/iWork '09.

    I was not "fooled by Excel's ability to recognize the file format and apply the correct converter automaticallY"
    What i mean is some people will export as a text file, but change the file extension to xls to force it to open excel when double clicked, and excel will open it just fine. Converting as it goes automaticaly and not even asking you any questions or putting up any errors.
    I know because i just did it to validate my statement (I am working at a Windows machine at the moment), and it worked fine. Even though the file was actually a tab delimited file, with an XLS on the end. If excel was strict, it would have looked for a Binary XLS file and rejected the file.
    This does NOT work with XLSX formats. You will get an error that its not formatted correctly. So if excel was able to recognize file formats and apply the correct converter automatically. they removed this ability in 2007+, only leaving it as legacy functionality.
    Your statement would be accurate for plain txt files. But excel is NOT ablel to ID the format automatically.
    Try saving a comma separated file with a  TXT extension, then try to open it by selecting "files of type" All files, in  an open dialog. It will start the converter for text files but will ALWAYS suggest Tab delimited. never the proper format if anything else. (we use Pipe | delimeted very often at work)
    thereby I present you the possibility that it is you that has been fooled by Excel into thinking it knows what its doing
    Jason

  • Thumbnails for Nef files with upated exposure in Capture NX2 revert to original exposure

    I did a batch processing in Nikon Capture NX2 to update the exposure for all Nef files in a folder.
    When displayed in Bridge (CS6) the thumbnails at first show the thumbnail with the updated exposure, then slowly updates all the thumbnails to the original exposure.
    How do I get Bridge to display the thumbnails with the updated exposure and keep bridge from reverting back to the original exposure?

    You can set different default parameters for Adobe Camera RAW, but they are still default parameters and this is what Camera RAW uses to render the RAW file instead of the parameters saved in the RAW file by either the camera or Capture NX2. 
    The camera saves a low quality jpg image in the NEF file (you can't change this) and if you edit the NEF file with Capture NX2 or View NX2 it saves a high quality jpg image in the NEF file, which increases file size by a considerable amount. 
    I process everything from the RAW file using Photoshop CS6 Adobe Camera RAW.  I have all in camera parameters set to nominal, active D Lighting off, and use Camera Neutral with a custom tone curve that was generated using the Picture Control editor.  In Camera RAW I use Camera Neutral v4 with the same custom tone curve as I used in modification of the Picture control profile.  My Camera RAW default is set using the modified Camera Netural v4 profile and I get excellent agreemnet between the Camera jpg and Camera RAW. 

  • Flash Player for FLV files with alpha channel encoded

    My goal is to play the the transparent background flash video on the bottom right hand corner similar to the video on this website : http://www.dropshipblueprint.com/
    I already have the FLV file with alpha channel encoded.  I was made to understand I will need a special flash player that can read alpha channel in the flv file to make the background transparent? Is this correct? If yes, then how to accomplish this or where do I get that player, maybe opensourece player?  If the player is not a solution then how do I accomplish my end objective taking into consideration I have the FLV file with the alpha channel encoded.  Thanks for your help. Sam

    Sam,
    Welcome to the forum.
    Where do you need to play this "sprite" (the name for such a Flash video)?
    If you need to add that to a Video, then there could be a few challenges in PrE.
    If you need to add it to a Web site, then Flash Player (free from Adobe) should be able to display that.
    Can you please give us just a bit more info, on how you wish to use the sprite?
    Good luck,
    Hunt

  • Quick look for text files with non-registered extensions

    It seems there was a way in 10.5 and 10.6 to register certain extensions with Quick Look to tell them how to preview a file. I have a lot of plain text files with different extensions that are not initially recognized by Quick Look. How do I hack the registry to tell Quick Look to preview a .cfg (or .aux, etc.) file as plain text?

    Can't Quick Look for some text files
    Re: Is it possible to change the viewing format?
    Quick Look for files without extensions.
    Re: Can I view text files without a .txt extension in Quick Look?
    How do I add support to Quick Look

  • Gui_upload for csv file with numeric n date fields

    Hi ,
      i searched on net on how to use GUI_UPLOAD for csv files using split function but the spilt function requires that the data type of all fields of the internal table should be character whereas in my case there is a numeric n data field too.So kindly help me how to do it.
    One way ppl might suggest that give all the fields as char in the internal n after recieving the data in the internal convert the required fields back to data n numeric n then finally insert to the database but if i have 80 fields u would really dont want to do that as it requires precision to convert it to the same type n length as in the original database for all the fields.

    yeah i guess that would be a bit longer if i m having more no of fields (80) compared to ORACLE where this can be done in a shorter way.
    SO i shall use 2 internal tables here rite?? i mean first one(with all fields as char) for storing the split function values and the other one (with actual data types) .CAN u plz tell me how to convert or cast from one data type to another n while moving values from 1st internal table to another  which way shall i do.
    Thanks for ur help n can u suggest if there is any other method for uploading csv also other than this split method n whether this method is better n faster than others.
    THANX

  • Change Open With for all files with a specific extension

    Hi, I've been using OS X for quite some time, but more recently cannot see how you do the following which is proving frustrating:
    * Open Get Info for a file,
    * Use the drop down under Open With to choose Other,
    * Select an appropriate application that wasn't on the drop down list (in this case Smultron text editor for CSV files),
    * Press the Change All button and the drop down turns back to Excel which was the previous default.
    So basically, how do I change all files with CSV extension to Smultron when Smultron wasn't in the list of Open With items and I have to use Other from the list. This is repeatable for any file type with any application that isn't listed and is on both my iMac and my work's MacBook. Try it yourself and you'll see what I mean!!
    Thanks

    Stuart Mchattie wrote:
    Thanks NeroWolf,
    Your solution does work for that single file, but doesn't change the system wide association of that file extension with a particular application. It is because this works that I believe the problem I am having is uncircumventable and is in fact a bug in the OS. Could anyone else confirm this?
    Cheers,
    Stuart
    It might be a bug. What I found is that the icon does not change unless I log out/in or reboot, even when the app normally puts an icon on the file.
    For example if I change an audio file to always open with VLC, it does even though the icon remains as before. However, even though clicking plays the audio with VLC, if I right click the file and select "Open With" it still says iTunes (app) default which is incorrect.
    Message was edited by: nerowolfe

Maybe you are looking for

  • J_security_check ques ???

    Hi , I'm trying to transplant my working test platform on winNT onto hp/ux 10.20. I've now got to the point where I have the url http://www.xxx.xxx/uni/course/login.jsp. When I enter some data, instead of the authentication happening, the same side n

  • Send notifications during R12 Payment process

    Hello, Does anyone know how to send notifications during the Payment process in R12. For example, I would like to send a mail to the Treasury department after the Payables department is done with invoice selection and confirmation of payments. This e

  • Accrual/defferal Document Clearing problem issue

    Dear Frnds, I have an strange issue with Document clearing. Accrual/ Defferal Document ( FBS1) contains 4 line items with 2 Vendors 1 is related to Credit memo and another one is an invoice. Accrual document normally cleared through reversal, but unf

  • The application microsoft excel can't be opened  -1712,  how to solve this problem to my mac book pro

    hi,  Recently i am facing a problem is some Exel files are not opening  and the error is -   THE APPLICATION MIRCROSOFT EXCEL CAN'T BE OPENED -1712. Why this is happend? Can any one support me to solve this prob.

  • Battery Cycle, replacement needed?

    I have heard of a 300 cycle/80% but I was not sure if that is just an estimation, or if Apple guarantees your battery will last that long. According to iStat, my battery is at only 49% health now and well below 300 cycles. Does this call for a replac