How to get the MIME type of the given file in R/3
Dear Experts,
Please tell me the FM or Class to get the given file MIME type in R/3 . I am using GUI_upload Function module to upload the file in R/3 .
Edited by: balaji ramadas on Jan 16, 2009 5:39 AM
Thank you Prosenjit I m using this FM CV120_GET_MIME_TYPE
to get the MIME type of the file
regards,
Balaji.R
Edited by: balaji ramadas on Jan 19, 2009 9:24 AM
Similar Messages
-
How to get the Mime Type of the file?
Hi Everyone!,
I want to upload a random file into my table as a BLOB and simultaneously want to fill the respective another column with its MimeType. Earlier I used Oracle Apex for this, but due to my new requirement I need to make this happen with the help of PL SQL and Forms. Could you help me in getting how we can upload the file and most importantly, how we can get its Mime-Type.
My chosen file can be of any type; it can be doc ,pdf,txt,xls ,gif or any other format.
If you could provide the example with your reply then it would be great.
Thanks
Harbinderhi
for that u have to use webutil.
declare
f varchar2(100);
begin
f := webutil_file.file_open_dialog();
if f is not null then
:doc.doc_name := f;
end if;
end;and
DECLARE
filename VARCHAR2(256);
BEGIN
filename := CLIENT_GET_FILE_NAME (File_Filter => 'jpg (*.jpg)|*.*|');
READ_IMAGE_FILE(filename, 'jpg', 'image');
END; sarah -
How to determine the MIME types of the files?
I'm making an application, in which I've to upload the files to the database. Now I want to insert into the database the MIME type of the files. Now how can I know that which type of the file is having which MIME type?
where can I get the list of all supported MIME types?
Even if I get the list, then every time I update the file in the database, so every time I have to check the file extension and then insert the MIME type...
this seems to be a tedioius job..
Is there any simple way to do this?I could ask "supported by what?" but I assume you will
be the one supporting them. Here's a link to the
latest list of registered MIME types.HERE's the link...
ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types -
How to get the mime type of the workflow attachment attached to workitem id
Hi Experts,
I can attach different types of attachment to the workitem id, lets suppost the attachment type attached is pdf, for this attachment I have an requirement to send the mime type as well. In this case the mime type is 'application/pdf' for pdf files.(for text file it is 'text/plain' and for zip file it is 'application/zip' and so on)
Do I have any place in ABAP world where I can get the mime type for different types of attachments.
I dont want to hard code the mime types, and I have checked the transaction 'SMW0', but not sure if this is the correct place to get the mime type.
Do you see any other way or tables which stores all these mime types.
Any help/suggestion would be appreciated.
Thanks and Regards,
Neerup.Hello,
Perhaps this can help:
http://help.sap.com/saphelp_nw04/helpdata/en/ad/ebe5cc1d75aa43a2871717d76f475d/content.htm
If you want to know the table name, turn on tracing (ST05) when accessing the MIME types.
regards
Rick Bakker
Hanabi Technology -
Need to get the MIME type of Files
hi
I have a table which contains Partno and the images name i.e PRODUCT_AWG_20070416 and the data would be like that :-
partno img_name
PX1 px1.jpeg
PX2 px2.jpeg
PX3 px3.jpeg
Now one by one i am Inserting those files into my table (img_temp -BLOB Column) which are exists in directory & the map file. but i also need to insert the MIME type of the inserted file. can you please provide me the way to generate MIME type on the basis of file type like (JPG,GIF,TXT etc).
the procedure i am using is as follows :
hi
I have a TABLE which contains Partno AND THE IMAGES NAME i.e PRODUCT_AWG_20070416 AND THE DATA would be LIKE that :-
partno img_name
PX1 px1.jpeg
PX2 px2.jpeg
PX3 px3.jpeg
Now one BY one i am INSERTING those files INTO my TABLE (img_temp -BLOB COLUMN) which are EXISTS IN DIRECTORY & THE map FILE. but i also need TO INSERT THE MIME TYPE OF THE inserted FILE. can you please provide me THE way TO generate MIME TYPE ON THE basis OF FILE TYPE LIKE (JPG,GIF,TXT etc).
the reason of this requirement is, we need to use that table in APEX 2.2 fromwhere i can download the inserted file and to download the file we need to get correct MIME_TYPE of that file.
Please Suggest me the way.
Thanks.
The Procedure which i am using is as follows :
CREATE OR REPLACE PROCEDURE img_uploader IS
CURSOR Cur_img IS SELECT part_no,image_file FROM PRODUCT_AWG_20070416
WHERE Transaction_id =1 ;
l_bfile BFILE;
l_blob BLOB;
BEGIN
FOR Cur_img_val IN Cur_img LOOP
l_bfile := BFILENAME('SOLVS_PRODUCT_IMG', Cur_img_val.image_file);
INSERT INTO img_temp (part_no,MIME_type,file_name, img)
VALUES (Cur_img_val.Part_no,NULL, Cur_img_val.image_file,EMPTY_BLOB())
RETURN img INTO l_blob;
DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);
END LOOP ;
COMMIT;
END;Hello,
Perhaps this can help:
http://help.sap.com/saphelp_nw04/helpdata/en/ad/ebe5cc1d75aa43a2871717d76f475d/content.htm
If you want to know the table name, turn on tracing (ST05) when accessing the MIME types.
regards
Rick Bakker
Hanabi Technology -
The MIME type for xslx file is different in Mozilla 13.0.1
The MIME type for a xslx file is coming as "application/vnd.ms-excel.12" in Mozilla 13.0.1 instead of the "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" which comes in other browsers when using fileUpload.PostedFile.ContentType
Firefox usually gets the MIME type from the MIME database registry key.
* HKEY_CLASSES_ROOT\.xslx
* HKEY_CLASSES_ROOT\MIME\Database\Content Type -
Setting the content type inside the ABAP mapping.
Hello All,
Can any one help me by telling me how to set the content-type inside ABAP mapping. I have searched a large no of blogs and help.sap.com for the same.
My requirement is I want to change the MIME type of the Main Document in side SXMB_MONI so that can change the content type of Main document which is application\xml by default.
I would appreciate an early response regarding the same.
AbinashHello Raj,
The output of my ABAP mapping is a flat file. So when I try to open the file with content type application/xml in the message monitor it shows the file has some error which is natural. The way to get around this problem is change the content type to application\txt from application\xml.
I am not finding an option to set the content type inside the ABAP mapping for the same.
Abinash -
How to get the 'mime-type' of a Resource accessed via WebDAV
Hello,
When a document is uploaded into a folder which is managed by a WebDAV RepositoryManager we don't see a Property 'mime-type' or something like that.
Our code:
<i>IPropertyMap lijstProp = tempResource.getProperties();</i>
In the list there is no Property 'contenttype' or something like that!
This is a bit of a surprise to me since it seems to me a very relevant Property of a Resource.
How can the mime-type/contenttype of a Resource managed by a WebDAV Repository Manager be determined?
Kind regards,
Maarten RuttenHi Thilo,
We access the Resources via API.
When I use "IPropertyMap lijstProp = tempResource.getProperties();" I assume that ALL the available properties are in 'lijstProp'.
(is this correct?)
I don't have the Property "contenttype" available in 'lijstProp'.
A workaround could be that when adding documents to a folder via API's, we also should set this Property via API's.
But when documents are added directly into the WebDAV folder we don't have that option. So, when we find a Resource with the Property 'contenttype' missing the only option I see is to 'calculate' the contenttyype based on the extension of the Resource.
Do you agree?
Kind regards,
Maarten -
How I can get the Billing Type for the sales order and its items
How I can get the Billing Type for the sales order and its items. I mean from which SAP tables and how?
Hi,
You need to use two tables.
First use VBFA. Enter the sales order number in the field Predecessar and the value M in SubCt field. This will give all the billing document number for the sales order items.
Then use the billing document numbers in table VBRK, where in you can get the billing document type.
Regards, -
How do I set the mime type for an attachment to "application/zip"
I'm sending out an email with a zip file as an attachment. The following code works fine, but the Mimetype for the attachment is set to "application/octet-stream"
FileDataSource fds = new FileDataSource(zipname);
DataHandler dh = new DataHandler(fds);
MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setDataHandler(dh);
mbp2.setFileName(fds.getName());
I would like the mime type to be application/x-zip. Unfortunately I seem to need a data content handler for this mime type as I get this exception.
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/x-zip
Building a date content handler in the activation framework seems like a lot of work to do a very simple thing. Am I missing something obvious? Is there a simple way to do this?I found the solution after much chasing around. The default mimetypes file that comes with the activation framework does not list zip.
-
How to extract the mime type using HttpExchange?
Hi,
I am using Sun httpserver to implement an HTTP Server. I am implementing the class HttpHandler and so implementing the method,
public void handle(HttpExchange t) throws IOException
}I just need to know, in the above method, is there a proper way to know the Content-type to know the mime type? Or I would have to traverse through all the headers?
Regards,
Kashif[HttpExchange.getRequestHeaders()|http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpExchange.html#getRequestHeaders%28%29] returns a Map...
-
JS - How do I Find the MIME type of a Link?
I need to be able to find the MIME type of a linked item in InDesign. Is there a simple way to do this?
@Peter – Indesign CS5.5 v7.5.3 on OSX 10.6.8:
app.placeableFileTypes:
sDnI, sMdI, dDnI, 3dDI, 4dDI, 5dDI, 6dDI, 7dDI, 2dDI, t5DI, t6DI, t7DI, t2DI, 3DCI,
5xCI, 2xCI, 3PM, EVAW, WALU, FFIA, LV4F, LVLF, LFWS, GEPM, aGPM, vGPM,
xGPM, , VooM, xcod, 8SLX, FTR, NB8W, NBDW, xslx, TXET, txtu, TXET, FSPE, PSPE,
TXET, FTCP, PTCP, TCIP, FFMW, PFMW, TXET, FDP, fGNP, SPB8, XCP, PMB,
ELR, fFIG, TC.., FFIT, 1PT, GEPJ, FIFJ, GPJp
app.placeableFileExtensions:
inds, idms, indd, indt, incd, incx, icml, mp3, WAV, WAVE, AU, AIF, AIFF, F4V,
MP4, FLV, SWF, MPG, M15, M1A, M1V, M64, MP2, MPA, MPM, MPV, M1S, M75,
MPEG, AVI, MOV, docx, xls, rtf, doc, doc, xlsx, txt, utxt, TXT, EPS, AI, TRP, DCS,
PMG, PCT, PIC, WMF, EMF, joboptions, pdf, pdp, PNG, PSD, PDD, PCX, PCC,
BMP, RLE, GIF, SCT, CT, TIF, TIFF, TP1, JPG, JPEG, JPE
Note:
empty array element between "xGPM" and "VooM"
first blank in " 3PM", " FTR", " FDP", " XCP", " PMB", " ELR" and " 1PT"
and the two dots in "TC.."
Uwe -
The content type for office excel 2007 in jsp page and the mime-type in we
Hi,
In my system MS Office 2007 is installed. I am trying to generating excel sheets from JSP page by setting the content type "application/vnd.ms-excel" in jsp page and as well as in web.xml file. I am getting the below message
The file you are trying to open, 'xxxxxxxx.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
Then finally the excel file is opening and displaying properly. If in my system MS Office 2003 is installed , then the above message is not coming.
I have changed the content type according to Excel 2007 <%@ page contentType= "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" %> and in web.xml file the mime type to
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>
even the content type is changed according to office excel 2007 , i am getting the same above message.
My client is asking not to display the above message. So how to prevent that message ?
It's very great if any body reply me as soon as possible.Hi Akash,
I am not using the POI. I am generating the excel sheet using the below code.
<jsp:directive.page import="java.util.Map" />
<jsp:directive.page import="lehman.ra.Report.ReportDefinition" />
<jsp:directive.page import="lehman.ra.RAUtilBean" />
<jsp:directive.page import="java.util.ArrayList" />
<jsp:directive.page import="lehman.util.GeneralUtil" />
<jsp:directive.page import="lehman.admin.report.AdminHtmlReportFormatter"/>
<jsp:directive.page import="lehman.helper.irprod.IRProdHelper"/>
<%@ page contentType= "application/vnd.ms-excel" %>
<jsp:directive.page import="java.util.Iterator"/>
<jsp:directive.page import="java.util.HashMap"/>
<%
String strTradeDate = (String) session.getAttribute("TradingDate");
String sContextPath = request.getContextPath();
IRProdHelper irHelper = new IRProdHelper();
String sReportFormat = "E2E";
String subtab1 = request.getParameter("subtab1");
if (subtab1 == null)
subtab1 ="";
Map report_Ids = (Map) session.getAttribute("ADMIN_E2E_REPORTS");
AdminHtmlReportFormatter formatter = new AdminHtmlReportFormatter();
ArrayList contentData = new ArrayList();
ArrayList headerData = new ArrayList();
ArrayList metaData = new ArrayList();
Map resultMap = null;
String headerString = "";
String contentString = "";
String reportId = "";
int titleSpan = 5;
if( report_Ids!=null && report_Ids.size() > 0){
Object oReportObj = null;
Iterator rowIter = report_Ids.keySet().iterator();
RAUtilBean raUtilBean = new RAUtilBean();
ReportDefinition rdef = new ReportDefinition();
while ( rowIter.hasNext() ){
oReportObj = rowIter.next();
reportId = oReportObj.toString();
System.out.println("**************reportId="+reportId);
resultMap = (HashMap) report_Ids.get(oReportObj);
if(resultMap == null )
continue;
if(resultMap.size() > 0 ) {
contentData = (ArrayList)resultMap.get(GeneralUtil.CONTENT_DATA);
headerData = (ArrayList)resultMap.get(GeneralUtil.COL_METADATA);
metaData = (ArrayList)resultMap.get(GeneralUtil.METADATA);
rdef = new ReportDefinition();
raUtilBean.setReportAttributes(rdef, headerData, metaData,reportId, sReportFormat);
titleSpan = raUtilBean.findMaxCol(contentData, rdef.getDisplayCols());
if("51031".equals(reportId)){
if(resultMap.get("HIDE_ETA")!=null){
boolean hideETA = ((Boolean)resultMap.get("HIDE_ETA")).booleanValue();
formatter.setHideETA(hideETA);
if(hideETA){
titleSpan = titleSpan-1;
rdef.setMaxCol(titleSpan);
headerString = formatter.constructHeadingForE2E(rdef, headerData);
contentString = formatter.constructContentForE2E(rdef, contentData, strTradeDate, sReportFormat);
%>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<meta name="ProgId" content="Excel.Sheet"/>
<meta name="Generator" content="Microsoft Excel 9"/>
<link rel="File-List" href="./Test33_files/filelist.xml"/>
<link rel="Edit-Time-Data" href="./Test33_files/editdata.mso"/>
<link rel="OLE-Object-Data" href="./Test33_files/oledata.mso"/>
<link href="<%=sContextPath %>/llehman.css" rel="stylesheet" type="text/css">
<link href="<%=sContextPath %>/llcontent.css" rel="stylesheet" type="text/css">
<style>
<xsl:comment>
table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
.xl21
{mso-style-parent:style0;
color:black;
font-size:8.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
border-top:.5pt solid silver;
border-right:.5pt solid silver;
border-bottom:.5pt solid silver;
border-left:none;}
.xl24
{mso-style-parent:style0;
mso-number-format:"\#\,\#\#0\.00_\)\;\\\(\#\,\#\#0\.00\\\)";}
.xl25
{mso-style-parent:style0;
mso-number-format:0%;}
.xl26
{mso-style-parent:style0;
mso-number-format:"\#\,\#\#0_\)\;\\\(\#\,\#\#0\\\)";}
.xl27
{mso-style-parent:style0;
background-color:#666666;
color:#FFFFFF;
font-size:9.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
text-align:left;
vertical-align:middle;
border-top:none;
border-right:.5 pt solid silver;
border-bottom:.5pt silver;
border-left:none;
mso-pattern:auto none;
white-space:normal;
.xl55
color:black;
font-size:8.0pt;
font-weight:700;
mso-style-parent:style0;
mso-number-format:"\#\,\#\#0_\)\;\[Red\]\\\(\#\,\#\#0\\\)";
mso-pattern:auto none;
font-size:9.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
text-align:right;
border-top:none;
border-right:.5pt solid silver;
border-bottom:.5pt solid silver;
border-left:none;
.xlDate{
mso-style-parent:style0;
mso-number-format:"yyyy\\-mm\\-dd";
.xlDateTime{
mso-style-parent:style0;
mso-number-format:"yyyy\\-mm\\-dd\\ h\\:mm\\ AM\/PM";
</xsl:comment>
</style>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name><%=subtab1%></x:Name>
<x:WorksheetOptions>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</head>
<body text="#000000" style="margin-left:5px;margin-top:5px">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table border='0' cellpadding="0" cellspacing='0' width="100%">
<tr class="xl21">
<td align="left" nowrap style='font-size:11px;' colspan="<%=titleSpan%>"><b><%=subtab1%></b> - COB <%=irHelper.formatDate(strTradeDate)%> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- Report Processing -->
<tr>
<td>
<%=headerString%>
<%=contentString%>
</td>
</tr>
<%
}//end of if
}//end of while
}//end of if report_Ids
%>
</table>
</body>
</html> -
How to find out which type of the driver is used in our application?
Hi all,
can anyone tell me how to find out which type of the driver is used in our application?
Thanks in advance,
PhoenioxHi,
Check out this...
Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
List drivers = Collections.list(DriverManager.getDrivers());
for(int i=0;i<drivers.size();i++)
Driver driver = (Driver)drivers.get(i);
String driverName = driver.getClass().getName();
System.out.println("Driver "+i+":::"+driverName);
you need to load the driver and display in the same program.
Then only you'l get the required result.
prakhyath -
How to Find the Data Type of the Field In a Database Table
Hi Experts,
I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It would be helpful if a demo example could be provided.
Thanks a lot.Hi,
Use this..
DESCRIBE FIELD dobj TYPE typ.
write typ.
type will contain the data type of the object.
and check this thread also....
Re: How to get datatype of fields in dynamic structures
Cheers,
Simha.
Reward all the helpful answers..
Maybe you are looking for
-
What's wrong with my iMac screen?
It just happened this morning when I woke up, this iMac is only few months old. And I did nothing last night, just edited some photos and watch The Walking Dead with VLC app as usual. Then I fell asleep and these lines just came up in the morning. Wh
-
I use Firefox and Internet Explorer on my desktop and sync the bookmarks between them using XMarks. I then sync my Internet Eplorer bookmarks to my iPad using iTunes. On top of all of my bookmarks, which sync fine, I have 2 extra empty folders call
-
My daughter has somehow figured out how to register for her own Apple ID but she is very underage. She is not giving me the correct info for me to get into her email. She has downloaded some apps that I would not allow. How can I recover her Apple ID
-
If I do a full system restore on my MBP will i get ilife off of the boot disks that came with the computer. Hi on my MBP i am going to restore it. It came with iLife will this be on the boot disks? Thanks
-
Find photos in iphoto6 without KeyWords
I am cleaning up my iphoto library and have been using keywords. I am near done and I want to find photos that I have NOT added a keyword to. Is there any way to just sort and view only photos that do not have a keyword?