Solution to upload images by creating mime repository

Hi
We need to implement a solution in retail where and enduser will upload the images of different retail items which needs to be accessed by buyers.
We need to understand the best possible way on following
1. How do we create repository where an image can be uploaded without creating transport requests.
2. How can webdynpro application access the image if the archiving is done.
Thank you
Barin

Hi,
I am just putting one of my posted replies to you.
1)You can use the program BSP_UPDATE_MIMEREPOS to upload the photos in the mime repository.
2)Use the following code to get the content from your mime and set the content to your interactive UI element as Xstring format.
data:
mime_repository type ref to if_mr_api,
content type xstring,
url type string value '/SAP/BC/BSP/SAP/myBSPapplication/rajkumar.jpg' .
mime_repository = cl_mime_repository_api=>get_api( ).
call method mime_repository->get
exporting
i_url = url
importing
e_content = content.
wd_context->set_attribute( name = 'DATAS' value = content ).
Thanks,
Rajkumar.S

Similar Messages

  • Form builder and MIME repository

    Hello,
    I want to add an image in my form.
    This image is uploaded like a MIME Object to have an URL address.
    But when I indicate this URL in the dedicated field, the image does not display.
    Can you have a solution to display an image from a MIME repository.
    Thanks for your answer.
    Regards,
    Séverine.

    Hi Séverine
    note that the documentation in the Help Portal http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/a670692dbc494fb5416fdaa93ee1a9/frameset.htm under 4. states that you cannot access a graphic in the MIME repository via URL. You need to include it as graphic content. You need to define this in the print program.
    To use a URL, you need to store the graphic on a dedicated server and create the reference to this server.
    Cheers,
    Markus Meisl
    SAP NetWeaver Product Management

  • Usage of MIMEs Repository

    Hi,
        Please brief about the usage of MIMEs repository and how to use it. I wud appreciate a real time application of MIMEs object.
    Cheers,
    Sam

    Hi Sam,
        There is a standard example named "WDT_QUIZ". In this they have used MIME object. If you want to use/download the image present in another webDynpo component, then select the image under the mime folder in the WebDynpro component and right click on the image and select Upload / DownLoad >> DownLoad.
    Download the image in to local directory.
    Then right click on the webdynpro component where we want this image to be uploaded. click on Create >> MIME object >> Import and select the image which we downloaded to the local system, a pop up appears click on save button.
    Once we uploaded the image in to the WebDynpro component an entry named MIMEs appears, we can see the image under the mime's.
    Hope this will help you.
    Cheers,
    Darshna.

  • How to upload image using JSP

    hi,
    i am confronting a problem how to upload image from local PC to web server . I am using Tomcat 4.0
    please help me by sending code
    thanks

    Hi,
    Here is the solution for uploading images and displaying images. I am using struts with JSP, so this code has a Action and ActionForm class. You can put the same code in Java Beans or Servlet class to run it. This code has two JSP files - one for Upload (upload.jsp)and other for Image(image.jsp) display. It has a Servlet also to display the image. Here is the code file wise.
    Upload.jsp **********************************************************
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="uploadAction.do" enctype="multipart/form-data" method="POST">
    <p>File to upload   
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit value="Upload" property="upload"/></p>
    <p> </p>
    <p><html:img src="image.jsp"/></p>
    <p> </p>
    </html:form>
    </body>
    </html:html>
    Image.jsp*****************************************************************
    <jsp:useBean id="upload" class="uploadtest.uploadActionForm" scope="session">
    </jsp:useBean>
    <%
         byte[] rgb=(byte[])session.getAttribute("byte");
         request.setAttribute("byArr", rgb);
    %>
    <!--
    The image data is now on the request object.
    Forward the user to the showImage servlet.
    That servlet will process and display the image data contained on the request object.
    -->
    Image is<p>
    <jsp:forward page="/showimage" />
    Struts Action Class - UploadAction.java **************************************************
    import javax.servlet.http.*;
    import java.io.*;
    import org.apache.struts.upload.FormFile;
    import org.apache.struts.action.*;
    public class uploadAction extends Action {
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
    uploadActionForm upload = (uploadActionForm) actionForm;
    try {
    int size=upload.getFileUpload().getFileSize();
    //if (image != null) {
    byte[] byteArr = new byte[size];
    //Create an input stream to read the uploaded file.
    ByteArrayInputStream bytein = new ByteArrayInputStream(upload.getFileUpload().getFileData());
    // Load the input stream into the byte Array.
    bytein.read(byteArr);
    // Close the input stream.
    bytein.close();
    // Load the byte[] into the content field.
    upload.setContent(byteArr);
    HttpSession ses=httpServletRequest.getSession();
    ses.setAttribute("byte",byteArr);
    return actionMapping.findForward("success");
    } catch (Exception ex) {
    ex.printStackTrace();
    return actionMapping.findForward("success");
    Struts ActionForm class ---uploadActionForm.java***************************************************
    package uploadtest;
    import org.apache.struts.action.*;
    import org.apache.struts.upload.*;
    import javax.servlet.http.*;
    public class uploadActionForm extends ActionForm {
    private FormFile fileUpload;
    private byte[] content;
    public FormFile getFileUpload() {
    return fileUpload;
    public void setFileUpload(FormFile fileUpload) {
    this.fileUpload = fileUpload;
    public byte[] getContent()
    return content;
    public void setContent(byte[] theFile)
    this.content = theFile;
    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    Servlet to display image --- ShowImage.java ********************************************************
    import java.io.*;
    import java.util.*;
    public class ShowImage extends HttpServlet {
    //Initialize global variables
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    byte[] rgb = (byte[]) request.getAttribute("byArr");
    if (rgb != null)
    response.setContentType("image/gif");
    OutputStream stream = response.getOutputStream();
    stream.write(rgb);
    else
    response.setContentType("text");
    response.getWriter().write("attribute byArr not found");
    This code will enable to to upload and display the image. If you know Struts, then you can write the Struts-Config.xml file by yourself. Other wise write to me, I will send you that. If you want to save the image in database, then you have to keep it as BLOB datatype is database. For database you need to send the byte array in the uploadAction.java file to database. Database will keep the image as binary.
    Thanks
    Amit

  • Importing a mime object from mime repository.

    Hi,
        Where to place our own image files in mime repository, and tell me the process of importing it to our application.
    Regards,
    Sachidanand.B

    Hi,
    here you can find some pointers to handle MIME's:
    <a href="http://help.sap.com/saphelp_webas610/helpdata/en/46/bb1835ab4811d4968100a0c94260a5/frameset.htm">http://help.sap.com/saphelp_webas610/helpdata/en/46/bb1835ab4811d4968100a0c94260a5/frameset.htm</a>
    grtz
    Koen

  • Logo from MIME Repository

    Hi
    I have to upload a logo from mime repository. I have uploaded the graphic into the mime repository, but I have no idea how to proceed. Please guide.
    Regards
    Dinesh

    Check out the help.sap.com for this. you get ->
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/a670692dbc494fb5416fdaa93ee1a9/content.htm">Insert graphics</a>
    - anto

  • Uploading an image to MIME repository using upload UI element.

    Hello All.
    I am trying to upload an image to MIME repository using the upload UI element.
    How to achieve this.
    Rite now I am able to add it to the internal table but it is getting stored using some other name.
    I want it to get stored using the same name of the image file.
    Regards,
    SampathKumar.

    HI SampathKuma,
    could you please provide the steps/coding which you used? I have the same requirement..
    Thanks

  • How to upload image in MIME repository  from bsp application

    Hi,
    I want to upload Image in MIME repository from my BSP Application. I want to access again or reuse uploaded image later in my BSP application. Can you please help me how to do this?
    I already go through http://help.sap.com/saphelp_nw2004s/helpdata/en/eb/8c683c8de8a969e10000000a114084/frameset.htm.
    but this is not helpful in my case. It only uploads in cache (temporary) not in MIME repository.
    Thanks

    Hi Prashant,
    In Layout...
    <%
    data: icon_save   type string.
    icon_save   = cl_bsp_mimes=>sap_icon( id = 'ICON_SYSTEM_SAVE' ).
    %>
    For using image globally...
    If you need to upload an image to MIME Repos Go to transaction se80> MIME Repository>
    sap->bc->bsp->sap->public->bc->bsp->icons ---> right click on icons folder --> import mime objects
    Regards,
    Anubhav

  • How to upload image in mime repository

    i want a report to upload  image in mime repository.
    , i want a report to delete the image (every week) from mime repository
    and how to get the url of that image ....
    Regards
    Anbu B

    Hi,
    Hope the following Threads will help you regarding your problem.
    How to upload an image to mime repository to display in alv grid with objec
    Thanks.
    Nitesh

  • Problem in uploading an image into a CM repository!!

    Hi All,
         I am trying to use the Fileupload element in JSP dynpage.
         My screen has the Fileupload element and a button.
         <b>I want to upload an image into a CM repository.</b>
         I have put <hbj:form id="myFormId" encodingType="multipart/form-data" > in my jsp page.
         The <b>'onClick'</b> method is <b>'onLoadFile'</b>.
         <i><b>The following is my code:</b></i>
    public void onLoadFile(Event event)
                   FileUpload fu =
                        (FileUpload) this.getComponentByName("myfileupload");
                   if (fu != null) {
                        //    Get file parameters
                        IFileParam fileParam = fu.getFile();
                        //    Get the temporary file name
                        File f = fileParam.getFile();
                        String fileName = fileParam.getFileName();
                        //    Get the selected file name
                        String ivSelectedFileName = fu.getFile().getSelectedFileName();
                        try {
                             int len = (int) f.length();
                             byte a[] = new byte[len];
                             FileInputStream fin = new FileInputStream(f);
                             fin.read(a);
                             String FileContent = a.toString();
                             IPortalComponentRequest request =
                                  (IPortalComponentRequest) this.getRequest();
                             com.sapportals.portal.security.usermanagement.IUser user =
                                  (com.sapportals.portal.security.usermanagement.IUser) request.getUser().getUser();
                             IResourceFactory factory = ResourceFactory.getInstance();
                             IResourceContext context = new ResourceContext(user);
                             RID rid = RID.getRID("/documents/test");
                             IResource resource = factory.getResource(rid, context);
                             if (resource != null) {
                                  ICollection parent =
                                       (ICollection) ResourceFactory
                                            .getInstance()
                                            .getResource(
                                            rid,
                                            context);
                                  String out = new String(FileContent);
                                  ByteArrayInputStream data =
                                       new ByteArrayInputStream(out.getBytes());
                                  IContent content =
                                       new Content(data, "text/html", data.available());
                                  IResource fileResource =
                                       parent.createResource(fileName, null, content);
                        } catch (Exception e) {
                   <b>..... REMAINING CODE...</b>
    I uploaded <b>abc.jpg (<i>size: 2KB</i>)</b>, then, an image file with the same-name is being created in the <b>/documents/test</b> folder but the size is <b>10Bytes</b> only. <b>I am not able to see the image</b> too.
    Can any1 help me plzzzz??? Would appreciate any kind of help.
    Thanks in advance.
    <b>
    Regards,
    Sai Krishna.</b>

    I would guess that this is because of the way you try to read the file contents. Maybe you should add some debug statements to find out what you're realling setting as content. It's certainly not KM's fault.
    The following sequence of statements looks wrong:
    nt len = (int) f.length();
    byte a[] = new byte[len];
    FileInputStream fin = new FileInputStream(f);
    fin.read(a);
    String FileContent = a.toString();
    IPortalComponentRequest request =
    (IPortalComponentRequest) this.getRequest();
    com.sapportals.portal.security.usermanagement.IUser user =
    (com.sapportals.portal.security.usermanagement.IUser) request.getUser().getUser();
    IResourceFactory factory = ResourceFactory.getInstance();
    IResourceContext context = new ResourceContext(user);
    RID rid = RID.getRID("/documents/test");
    IResource resource = factory.getResource(rid, context);
    if (resource != null) {
    ICollection parent =
    (ICollection) ResourceFactory
    .getInstance()
    .getResource(
    rid,
    context);
    String out = new String(FileContent);
    ByteArrayInputStream data =
    new ByteArrayInputStream(out.getBytes());
    IContent content =
    new Content(data, "text/html", data.available());
    Why don't you just pass the FileInputStream into the Content object's constructor???
    Best regards, Julian

  • Uploading images whit thumbnail to MDM repository using Java API

    Hello,
    can someone tell me how to upload images whit thumbnail to MDM repository using Java API?
    i get following message using setHasThumbnail(true):
    com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Ungültiger Wert für Parameter
    thanks

    You can upload images to MDM via the API, but the only way to create thumbnails is via the MDM Data Manager application which uses some embedded libraries to do the work.
    Walter

  • How do i create a website that allows customer to upload images and text?

    I need some help i have a friend who has asked me if i can create a website that allows them to upload their own images and text at their leisure.
    His company is in the car sales trade so they need to regularly be updating their stock, and this needs to be done by somebody with limited computer knowledge so ease of use is fairly important.
    I am using dreamweaver cs4 on a G5 Imac running Snow leopard 10.6.8, my skills are limited to creating uncomplicated websites but i am very keen to learn, i am aware of content management systems such as Druplal but have zero knowledge on how to use these.
    Any assistance would be greatly appreciated
    Andy Barrington
    www.andybarrington.com

    You can take a read here
    http://www.hotscripts.com/category/php/scripts-programs/classified-ads/autos/
    http://icloudcenter.com/auto-dealer-car-sales-script.htm
    Although putting together a form that would upload images and all the descriptions required seems like a fairly straghtforward project, depending on your current skill set.
    Gary

  • Change of image in web reports (MIME repository : SE80)

    Hello,
    i want to replace company logo in web reports.
    i have changed the logo (image) through MIME repository in SE80 transaction, but i am unable to see the unchanged logo on portal/web reports.
    What can be the issue. Is there any setting anywhere that needs to be done?
    Thanks,
    Shweta.

    Hi,
    Please check the Image name like
    supported ex:
       "company_logo.jpg"
    Not supported Example:
       "company logo.jpg"
       "company_logo.JPG"
       "Company_Logo.Jpg"
    Concerning the missing images in the WAD please check, if the images
    are available in the Mime Repository:
    Transaction SE80 -> MIME Repository -> SAP -> BW -> BEx ->
    Publisher -> GIFS -> WebItem_Previews -> e.g. "broadcast_prev.gif"
    Check the below link:
    http://help.sap.com/saphelp_nw70/helpdata/EN/44/4cd282bd414e35e10000000a1553f6/frameset.htm
    Thanks,
    Venkat

  • Image in MIME Repository is not showing on WAD or Webreport

    Hi,
    The image logo.gif is stored and can be shown in MIME Repository /sap/bw/Customer/Images. I have developed a webtemplate in WAD 7.0 addresses to those images by
    <img alt="logo" src="/sap/bw/Mime/Customer/Images/logo.gif />
    It is not showing i WAD nor in webreport when it is executed from WAD.
    I have tried <img alt="logo" src="bwmimerep://sap/bw/Mime/Customer/Images/logo.gif />
    it does not work neither.
    I have also tried to test the URL directly on the webbrowser  without success
    http:// (application server with port number)/sap/bw/Mime/Customer/Images/logo.gif
    What is the problem? How to make it work?
    Thanks and best regards,
    Zabrina

    hi,
    maybe the folder containing your logo is not served, so try this:
    tcode SICF and search if your folder is served or not (grayed), if it's grayed then right click the main service (sap) deactivate and activate again.
    you can also try to put your logo in folder under  /sap/bw/bex
    hope it helps.

  • Creating form with user uploaded image (not attachment)

    Is it possible to create a form with a space for user uploaded image?  Not attachment.
    Thank You

    This is not supported by FormsCentral.
    Jeff Canepa
    Software Quality Engineer
    Adobe Systems, Inc.
    [email protected]

Maybe you are looking for

  • Using a Calendar object in Forms 6i

    Hi, I've a problem when I use the STNDR20.OLB and CALENDAR.PLL. There's a missing procedure called "date_choosen" in the OLB & the form does not compile. Does anybody have a workaround for this or another OLB/PLL to resolve this issue ? thx Kalpana S

  • Macbook "Y" button problem. PLEASE HELP

    Hello all , mY "Y" button will not work unless I hold shift down. I'm not sure whY this is happening and I need advice on how to fix it. AnY ideas???

  • Odd SSL errors in webcache logs

    Oracle application server 10.1.2.3 using ssl. Im seeing this in my event_log for webcache over and over. Dosent seem to be service impacting, just curious why im getting them? [error 11321] [ecid: 130119394485,0] Connection from browser cannot be est

  • Searching Templates to Print DVD Cover on DVD Boxes From Pages or Keynote.

    i have iWork 06 and i want to print dvd jewel case or commercial boxes from Pages or Keynotes , i dont want to use third parthy applications. i just need templates i can import in iWork 06 , and work on them.

  • Removed PS CS3; now CS5 says there is a file missing.....

    I used the Adobe CS3 uninstaller to remove PS CS3. When I start PS CS5, I get an error message that there is a file missing from Application Support and telling me to reinstall CS5. Before I go ahead and uninstall CS5 and then reinstall it, I want to