Help!! Trying to post a file request from mobile to a jsp page

but getting the following error
Running with locale: English_United States.1252
file:///c:/images/Furl.png
java.io.IOException: File does not exist
at example.fc.UploadMidlet.getData(+71)
at example.fc.UploadMidlet.<init>(+48)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+34)
at com.sun.midp.midlet.Selector.run(Selector.java:150)
Unable to create MIDlet example.fc.UploadMidlet
java.lang.NullPointerException
at java.lang.String.<init>(String.java:594)
at example.fc.UploadMidlet.<init>(+51)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+34)
at com.sun.midp.midlet.Selector.run(Selector.java:150)
for code
package example.fc;
* UploadMidlet.java
* Created on September 10, 2007, 6:19 AM
import com.sun.midp.io.j2me.storage.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.io.file.FileConnection;
import javax.microedition.midlet.*;
* @author  Sudipa
* @version
public class UploadMidlet extends MIDlet {
    String type;
    String url;
    String agent;
    String encodedData;
    HttpConnection conn;
    public UploadMidlet()
        type=new String("image/png");
        url= new String("http://localhost:8086/SMPP/Upload2.jsp");
        encodedData=new String(getData(new String("c:/images/Furl.png")));
    public byte[] getData(String filename)
    { byte[] b=null;
    try{
//        File file=new File();C:\WTK25\appdb\DefaultColorPhone\filesystem
//         if(File.dirExists("C:/WTK25/appdb/DefaultColorPhone/filesystem/root1"))
//         { System.out.println("root1 exists");
//        if(File.dirExists("/root1/photos/"))
//        System.out.println("/root1/photos dir exists");
//        else
//         System.out.println("/root1/photos dir do not exist");   }
//         else
      System.out.println("file:///"+filename);
      FileConnection fc = (FileConnection)Connector.open("file:///"+filename);
      //  FileConnection fc = (FileConnection)Connector.open("file://e:/images/"+filename); 
         if(!fc.exists()) {
            throw new IOException("File does not exist");
         InputStream is = fc.openInputStream();
         b= new byte[(int)fc.fileSize()];
         int length = is.read(b, 0, (int)fc.fileSize());
         System.out.println
            ("Content of "+filename + ": "+ new String(b, 0, length));
      } catch (Exception e) {
          e.printStackTrace();
      finally{
          return b;
//          Enumeration filelist = fc.list("*", true);
    public void startApp() {
        try {
            conn = (HttpConnection) Connector.open( url );
            conn.setRequestMethod( HttpConnection.POST );
//          conn.setRequestProperty( "User-Agent", agent );
            conn.setRequestProperty( "Content-Type", type );
            conn.setRequestProperty( "Content-Length",new Integer(encodedData.length()).toString());
            OutputStream os = conn.openOutputStream();         
            System.out.println("success");
            String HeaderStr=new String("-----------------------------7d71f4623014c Content-Disposition: form-data; name=\"uname\" fsdgfs -----------------------------7d71f4623014c Content-Disposition: form-data; name=\"upfile\"; filename=\"_suite_8.png\" Content-Type: image/png");
            String FooterStr=new String(" -----------------------------7d71f4623014c--");
            System.out.println((HeaderStr+""+ encodedData.trim()+FooterStr).getBytes());
            os.write((HeaderStr+""+ encodedData+FooterStr).getBytes());
         //   String writer=new String("-----------------------------7d7261272b0184 Content-Disposition: form-data; name=\"uname\" ui -----------------------------7d7261272b0184 Content-Disposition: form-data; name=\"upfile\"; filename=\"C:/images/hone.ico\" Content-Type: image/x-icon 00�f �h�00 �%  ��B hnS(0`� p?��PXL���|d\���D$$l���`XxTTd�l80�������������L8$���x�xL<@����dT��x,,(� ������x��xp��|4 lth������dDD����lll\T���|tp���L<4\�p������������$ $������848������x���8$����� ��� `X`����ld����xp�������P@$|�xTHD��x���dPT�������tt������4 0H@t��x �����?�|hhD,0@0(p�?x�?p�xp?p?�?���� �� ?������ X@0�����������xX@@�� �p`�hX4,08,$��?�����x�?xd���0 h�h������dPH�xx�xlp``���X<8h x������������ �������?�� ������������0 ��xXLP������pPT����� P00p�x������pPH��?����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������;;o�������������_����������������������������DS*I������������L-L�����������������������O*I##�������������z=��������������������DDI-=������������L_L������������������D#-?�...:>#j������������->���������������Sj-?...�..zI*�����������_L������������Djz:��.��...b.=X#����������L_ ���������;�*L2N����..:l?>*�����������#������RX>��c���..�.r7 zj~����������_I_����S��c������.?a��'m.= X#�����������WX;;XX#=?N��cc�/.�-�\".CC7d��.:>������������DS�D��NNcccc--`.NH?\".Hm!�...�Nz#�����������DnS;OjjzH�N=2��V��.H����....���.c=IXj��������;�O~ Lzyy�NB@8\"�c\"8�/���...�����b���H�~��������~�>-K8L~z?Nx:H�NNc�c�:�b�b���b�Nz~~j�������%�K/#&8N�a�N�c�.c.?M8c����bc�cc=#X~�������2H?�N2j���..��K�N�\"?.�����? �*������-2H??�N)-~>�cc�g8.cV\"H.x\"��c�c�c�c�{Xj�������2�NN�K&I8�-\"�.�U.c�..���c�ccc=#X~�������-?NNN�>#!2c9U"".cN....b)?.�ccc�cc�XX�������!B/N�=y22?Nx�Nc�:/.?-�8c.���cc�L�X~�������2��?�cH{?2N�c/c�M8cHg/.���c����jXX�������K?����-�?8�VVNN\":�q����b�bcNc�*F�������=��c� -H2NaH\"`�5a�Nccccb�������N>X*#��������2H����N ?8��s`��Ncc�N�ccccc��cN=**y�������=??�N�y=:c���NN�NN�cc��?����ccccN�#XjF�����������N/>?hNcccc�cN=--=@���NN�cc>Xjj��������=?NNNNc2#=\"�c\�\�)�=cKUH�5\"NNN����cN-X*F��������������&?8c?{V2?N���NNN�?2M4�Nc�#*~���������=HNNN��#L2?�s555NNc��N?gM�E[�g�N�X����������2N�N*{NN�NNN?�4]�QQ$$J�?�N=X*����������=H�NNN##NHwAE]+Z��k$JJJ$p�!���H#X�����������8���?&*/ +tZQkk$JJJ��TAH�?�Wo�����������=H��N-j*r�EQ$$$J$?� \(^M�)�HH?*������������!��NH X&�[Tv M�ccc�NNH2��L�������������H?�N~*-NML,�ccc�N�?�2??������������������2?H?H�2&X 2NcNN?228??������������������������?�??H?{**�28!?�������������������������������!2H�#�����������������������������������������!�=W�����������������������������������������?2�2?������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������?�?����������������������������?����������������������������������( @�|��?H8T�d���tTL���<$(d���PH���  ������������xp$X�pthl@@Ht����� (�XH������D84�ll\LL�����?�?�����������|p\<<� ? t��P ht\\L,,\���TD���?�����,$ �d`����|l����������������?������� ���`?p�??�?�������<0, `P�����������������t�pp`�x�hhPPXx� �� ��?���������P@@P<4hLL� ?��������x\H@�h`�\\P08h�?�d\�������|x�?����������jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjfjjjjjjjjjjOjjjjjjjjjjjjjjjj*WWWWjjjjjjjjjjjjjjjjjjjjjjj*WWWWf^jjjjjjjOWOjjjjjjjjjjj*WWX00XjjjjjjjjWjjjjjjjjj*WW<0000XjjjjjjjOWOjjjjj*WWOGK00JG]\GXjjjjjjjW*jj**W*Hd000F -FY+jjjjjjOO+*BUKJdGU5BK$-ggCK+jjjjjjj1''1YBKTBd\5d9J00KXjjjjjj%3%*]59T[KJJJ0JK09Y+jjjjjLL6[\`^;i dKKKf4JKJ4+jjjj66[.U;%3ddef4[ZKJdJA+jjjjjH9T[*YU45""deKJKKKdK<%+jjjj[U4K5G& dKK0DJdKdK4O%jjjjj[9.U!9iidf9LBJJKdddB+Ejjjj[\.d_\B5V[].dJJKdd[%Ejjjjj\"9.UA*B9 g94edKdKKKJdi*+Wjjjjj[[99T*L?@?A?7789&3456*789& '()*+,-+./012% !\"#$$$$$$$% ������");
//            os.write();
            int rc = conn.getResponseCode();
        } catch (IOException ex) {
            ex.printStackTrace();
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
}

{color:#000080}I gather that you are on a Windows PC. Try changing this lineencodedData=new String(getData(new String("c:/images/Furl.png")));toencodedData=new String(getData("C:\\images\\Furl.png"));Also check the case of your folder and file names.
db{color}

Similar Messages

  • I am getting error 205 while trying to install Creative Cloud. I already had chated with support, Uninstalled CC and tried to install it again. From the Adobe site, the page keeps loading eternally, from the previous installer, it gives me error 205. What

    I am getting error 205 while trying to install Creative Cloud. I already had chated with support, Uninstalled CC and tried to install it again. From the Adobe site, the page keeps loading eternally, from the previous installer, it gives me error 205. What to do? Give up on CC?
    This is not the first time I get it, and it seems a recurring problem.

    Milliet are you on a managed network?  If not then please see Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html for information on how to resolve error 205.

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • How to open a local file from javascript in a jsp-page

    Hi
    I have created an iview from a PAR file. In the par file I have a jsp-page with some javascript code. From the javascript coe I want to open a new window with an Excel file.
    I have tried window.open("c:
    test.xls", "test_window"), but it doesn't seem to work. I have created a small HTML page locally with the same command and there a new window opens with the Excel file.
    If I change the local file path with an URL it also works.
    Any idea how to open a local file ?
    Thanks
    /Jakob

    Jacob,
    I'm not 100% (but 99,9%) and it has to do with security ristrictions of the browser not allowing to have local workstation interation from the web. This is ofcourse very dangerous if the browser would allow it... So therfore it is blocked. What if somone would point to a file/executable that formats your drive so for that reason it is not allowed to have web interaction with a local file. Only with Java Applets this is possible but still with many limitations, and what I remember Google Gears and Adobe Air do have some limited web 2 local file interaction... So best and most simple solution you are left with is pointing to a url instead of a file on a c:\ drive.
    PS The reason why it works when you start the html from your local PC has todo with the fact that the browser detects that the html is not running in the web at that moment therefor allowing the access.
    Cheers,
    Benjamin Houttuin

  • How to transfer the http request from applet to servlet/jsp

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

  • PLEASE HELP!!! using servlet to generate an image in jsp page

    Hi,
    I am so stuck on this... please help.
    I have a servlet that generated a gif image dynamically. It uses a bean that stores the gif image in a byte array.
    The servlet outputs the byte data to the output stream. The code is really simple and looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //HttpSession session = request.getSession();
            try {
                ServletOutputStream stream = response.getOutputStream();
                ImageByteInformation imageByteInfo = (ImageByteInformation) request.getAttribute("imageByteInformation");
                response.setContentType("image/gif");
                response.setContentLength(imageByteInfo.getByteData().length);
                stream.write(imageByteInfo.getByteData(), 0, imageByteInfo.getByteData().length);
                stream.flush();
            }catch( Exception e){   
                System.out.println("You are hooped!: " + e.getMessage() + " " + e.toString());           
            }When I redirect from the dispatch servlet straight to this servlet an image shows up in the browser window.
    However when I try to use this jsp page to display the image nothing happens...
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h2>Hello World!</h2>
            <img src="servlets/Map24ImageDisplayServlet"/>
             //I also tried src/servlets/Map24..., /src/servlets/Map24..., /display, servlets/display
            <h2>Did you see the image?</h2>
        </body>
    </html>My web.xml is here if it helps...
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name>HelloProject</display-name>
    <servlet>
        <display-name>ServletDispatcher</display-name>
        <servlet-name>ServletDispatcher</servlet-name>
        <servlet-class>servlets.ServletDispatcher</servlet-class>
      </servlet>
      <servlet>
        <display-name>Map24ImageDisplayServlet</display-name>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <servlet-class>servlets.Map24ImageDisplayServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletDispatcher</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
      <error-page>
        <error-code>404</error-code>
        <location>/404_error.html</location>
      </error-page>
      <servlet-mapping>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <url-pattern>/display</url-pattern>
      </servlet-mapping>
    </web-app>I can never get an image to come up. In fact I can never get the jsp page to run the servlet at all! HELP!!! What am I doing wrong?
    Thanks
    Edited by: Kind_of_Green on May 5, 2008 3:55 PM
    Edited by: Kind_of_Green on May 5, 2008 4:00 PM

    OK... so you WERE absolutely right about the src path for the image tag.
    However I also had another problem that was quite a bit more insidious and mostly just a symptom
    of how little I know about what goes on under the hood of a web app.
    My bean storing the image info was stored as a request attribute. When the servlet was called from the
    jsp page the request object was either reset or just never initialized. Anyway it is not the same request
    object I assumed it was being passed in the doGet method. I added my bean as a session
    attribute and everything is sparkly :)
    I can only assume that when a request is neither forwarded nor included (as is the case with
    calling the servlet from the img tag) it is disappeared.
    Anyway, thanks a mint man. I so totally appreciate your time.
    Ciao :)

  • Help!!! What's wrong with this code. JSP page can't retrieve properties.

    I'v got a piece of code that was created to send some parameters to JSP page via POST method. But in server page I can't retrieve this parameters, please help me and try to find "main" bug in this code.
    try {
    URL url = new URL("http://localhost/index.jsp");
    HttpURLConnection httpCon = (HttpURLConnection)url.openConnection();
    httpCon.setRequestMethod( "POST" );
    httpCon.setDoOutput( true );
    String body = URLEncoder.encode("name=Oleg", "UTF-8");
    httpCon.setRequestProperty( "Content-length", Integer.toString( outBody.length() ));
    httpCon.setRequestProperty( "Content-type", "application/x-www-form-urlencoded" );
    OutputStream os = httpCon.getOutputStream();
    PrintWriter ow = new PrintWriter( os );
    ow.print( body );
    ow.flush();
    ow.close();
    } catch (....) {
    }

    Hi
    You must not encode all the body just the values of the parameters.
    You can do as following in order to send a post request with 2 parameters
    String param1 = "Co & sons";
    String param2 = "ltd.";
    String encParam1 = URLEncoder.encode(param1,"UTF-8");
    String encParam2 = URLEncoder.encode(param2,"UTF-8");
    String body = "param1="+encParam1+"&param2="+encParam2;
    OutputStream os = httpCon.getOutputStream();
    PrintWriter ow = new PrintWriter( os );
    ow.print( body );
    ow.flush();
    //read the response from the jsp
    InputStream inS = httpCon.getInputStream();
    byte[] buff = new byte[5000];
    StringBuffer sbuff = new StringBuffer();
    int nrBytes ;
    while( (nrBytes = inS.read(buff, 0, 5000))!=-1) {
      sbuff.append(new String(buff,0,nrBytes));
    inS.close();
    ow.close();
    ...This is the jsp page which gets the parameters
    <%
         String param1 = request.getParameter("param1");
         param1 = new String(param1.getBytes(),"utf-8");
         String param2 = request.getParameter("param2");
         param2 = new String(param2.getBytes(),"utf-8");
    %>I hope I helped you.
    Regards,
    BG

  • Downloading xls sheet from application server using jsp page

    hi,
    I am creating an excel sheet and storing it in application server which runs on HP-UNIX OS. I want to download that excel sheet using jsp page. With the following code snippet i m able to access the jsp page, but i m not able to download xls sheet. its giving "the page cannot be found "error. Is there any other way to download the excel sheet from jsp page.
    <%
    out.println("<a href=\"./Download.xls\">Download excel</a>");
    out.println("<a href=\"./Download.jsp\">Download jsp</a>");
    %>
    Thx in adv.
    ritu

    href should be ur absolure path like
    http://servername:8080/files/Download.xls"
    pls try these and let me know
    shanu

  • Passing Parameters from Dashboard to a JSP page

    Hi,
    I have a table column of values displayed in dashboard. when a user clicks a value, that value should be send as a parameter to a JSP Page.
    Tell me how to add that column value as a parameter to the url which navigates to the JSP page. Should i use some presentation variables?
    If so give me the steps...
    Thanks,

    Hi Venkat,
    I am really happy to see your reply. i will explain my doubt clearly.
    I am using a presentation variable to store the column value selected by user(using a prompt). And i am using a Link (Dash board link ) to navigate to a jsp page.
    I want the presentation variable's value should be accessed in the JSP page...
    Now is it possible to pass the presentation variable's value through the url of the link to a jsp page.
    Eg: Let Presentation variable is file, and i had given the Link's url as
    http://localhost:9704/servco.jsp?file_id=@{file}
    i dont know whether this is the correct way. Please help me out in this....

  • How to use value returned from a bean in jsp page

    Hi All,
    I have a string array value being returned from a javabean to a jsp page. I want to be able to assign the value to a variable in the jsp page.
    How do I do this?
    Many thanks :)

    thanks for your response.
    I actually used something like this:
    <% String loggedin = log.User(user,password);
    out.println(loggedin);
    %>i am not yet as much of an expert on beans as i would like to be, but i thought it is not really a bean if it has a getter method which takes arguments?

  • Reg dynamically displaying records from database into a jsp page

    I am working in a project which is using struts and hibernate.In a class I gave code for retrieving data from a table and I put it in a list.
    List retrieveList;
    public List getRetrieveList() {
    String SQL_QUERY ="from student s";
    Query query = session.createQuery(SQL_QUERY);
    retrieveList = query.list();
    return retrieveList;
    public void setRetrieveList(List retrieveList) {
    this.retrieveList = retrieveList;
    And this list value I want to be displayed in a jsp page.What I have given is :
    <jsp:useBean id="records" class="StudentImpl" scope="session" />
    <bean:define id="list" name="records" property="retrieveList" />
    <table align="center" bordercolor="black" cellpadding="10" cellspacing="10">
    <logic:iterate id="data" name="list" type="pojo.student" indexId="index">
    <tr>
    <td><html:multibox property="checked" value=""></html:multibox></td>
    <td><bean:write name="data" property="studentname" /></td>
    <td><bean:write name="data" property="age" /></td>
    </tr>
    </logic:iterate>
    </table>
    When I run my jsp page its showing an error
    org.apache.jasper.JasperException: [Ljava.lang.Object; cannot be cast to pojo.Student
    can anyone resolve this problem?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    ya i got through criteria query.
    Transaction tx = session.beginTransaction();
              try{
                   Criteria query = session.createCriteria(Student.class);
                   list = (ArrayList)query.list();
                   tx.commit();
                   setRetrieveList(list);
                   session.close();
              catch(Exception e){
                   System.out.println(e);
              }

  • I Need Help Trying to Play (.pls) files in a simple windows forms Application

     So I'm try to build application that when I click on the icon it opens a little window and play the url .pls. I already got the graphics of the app i just to get the code and I've been looking around for but all i got was this code
    typedef struct
    int count;
    void **name;
    void **displayname;
    } Playlist;
    Playlist* my_playlist; // SHOUTCAST PLAYLIST
    #define BOX(text) MessageBox(NULL,text,"Info",MB_OK | MB_TOPMOST);
    char *stristr(char *string2, char *string1) // from /samples/fmod/Main.c
    char *s1 = strdup(string1);
    char *s2 = strdup(string2);
    char *ret = 0;
    int i, j;
    int len1 = (int)strlen(string1);
    int len2 = (int)strlen(string2);
    for (i=0;s1[i];i++) s1[i] = tolower(s1[i]);
    for (i=0;s2[i];i++) s2[i] = tolower(s2[i]);
    for (j=0;j < (len2 - len1);j++)
    char *a = s1;
    char *b = &s2[j];
    for (i=0;(i < len1) && *a && *b;a++, b++, i++)
    if (*a != *b)
    break;
    if (i == len1)
    ret = &string2[j];
    break;
    free(s1);
    free(s2);
    return ret;
    Playlist *ParsePlaylist(char *name) // from /samples/fmod/Main.c and MSDN
    char *filebuf, *p;
    Playlist *playlist = 0;
    int count, i;
    // Check if URL is null
    if (!name)
    BOX("Streaming URL is empty");
    return 0;
    // Check if URL is a *.pls file
    if (_stricmp((const char *)".pls", (const char *)(&name[strlen(name) - 4])))
    return 0;
    // Create a WinInet session
    HINTERNET hSession = InternetOpen(_T(""), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
    // Prepare a request
    HINTERNET hRequest = InternetOpenUrl(hSession, name, 0, 0, 0, 0);
    // Send the HTTP request.
    HttpSendRequest(hRequest, 0, 0, 0, 0);
    // Read the response data.
    DWORD dwNumberOfBytesAvailable = 0;
    do
    // Retrieve size of remote file
    InternetQueryDataAvailable(hRequest, &dwNumberOfBytesAvailable, 0, 0);
    if (0 < dwNumberOfBytesAvailable)
    // Allocate buffer memory
    filebuf = new char[dwNumberOfBytesAvailable + 1];
    filebuf[dwNumberOfBytesAvailable] = 0;
    DWORD dwBytesRead = 0;
    // Read remote file and put in buffer
    InternetReadFile(hRequest,
    filebuf,
    dwNumberOfBytesAvailable,
    &dwBytesRead);
    //BOX(filebuf);
    while (0 < dwNumberOfBytesAvailable);
    // Close the request handle.
    InternetCloseHandle(hRequest);
    // Close the WinInet session.
    InternetCloseHandle(hSession);
    // Parse the pls file (from Fmod sample)
    p = stristr(filebuf, "NumberOfEntries=");
    if (!p)
    BOX("Streaming : NumberOfEntries in pls file not found");
    return 0;
    p += 16;
    count = atoi(p);
    if (!count)
    BOX("Streaming : numeric value for NumberOfEntries not found");
    return 0;
    playlist = (Playlist *)calloc(sizeof(Playlist), 1);
    if (!playlist)
    BOX("Streaming : can't allocate memory for pls file (playlist)");
    return 0;
    playlist->count = count;
    playlist->name = (void **)calloc(sizeof(char *) * count, 1);
    if (!playlist->name)
    BOX("Streaming : can't allocate memory for pls file (playlist->name)");
    return 0;
    playlist->displayname = (void **)calloc(sizeof(char *) * count, 1);
    if (!playlist->displayname)
    BOX("Streaming : can't allocate memory for pls file (playlist->displayname)");
    return 0;
    for (i=0;i < count;i++)
    char tmp[32];
    char *filename, *displayname, *t;
    filename = displayname = 0;
    sprintf(tmp, "File%d=", i + 1);
    p = strstr(filebuf, tmp);
    if (p)
    p += strlen(tmp);
    t = p;
    for (;*t && (*t != 0xa) && (*t != 0xd);t++);
    if (*t)
    char tmpc = *t;
    *t = 0;
    filename = _strdup(p);
    *t = tmpc;
    if (strncmp(filename, "http://", 7) && strncmp(filename, "http:\\\\", 7))
    char *tmpname = _strdup(filename);
    p = &tmpname[strlen(tmpname) - 1];
    for (;(p > tmpname) && (*p != '\\') && (*p != '/');p--);
    if ((*p == '\\') || (*p == '/'))
    p++;
    displayname = _strdup(p);
    free(tmpname);
    playlist->name[i] = filename;
    playlist->displayname[i] = displayname;
    free(filebuf);
    return playlist;
    [main code]
    char string_music[256] = "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=6042&file=filename.pls"; // For example
    // Parse the remote file (in case it's a Shoutcast playlist (*.pls))
    my_playlist = ParsePlaylist(string_music);
    if (my_playlist)
    strcpy(string_music, (char*) my_playlist->name[0]); // for the first song in the playlist
    FSOUND_STREAM * my_stream = FSOUND_Stream_Open(string_music, FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
    int int_sound_mp3 = FSOUND_Stream_Play(FSOUND_FREE, my_stream);
    and i got to link it to Wininet.lib
    and I'm a noob so i got problems as soon as i tried to put everything together
    so any help greatly appreciated 
    BTW if you know any other ways, that I'll be able to stream the audio that will be great to.
    heres the link for the audio stream (.pls)
    http://panel3.serverhostingcenter.com:2199/tunein/nrlsxglp.pls

    Hello 0cooldex0,
    What library do you used in this scenario? I haven't saw this FSOUND_STREAM from MSDN library.
    By the way, winform general is used for talking about Windows Form library, is is using C# or VB.NET but not C or C++. You are not posting in the right forum.
    In my point of view, you may choose the forum depending on the library you choosed and post on specific forum.
    Regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I'm trying to process RAW file images from my SanDisk memory card on Adobe Photoshop CS4 Extended and am unable to do so. Which level Adobe Photoshop do I need to process SanDisk images?

    I'm trying to process RAW images from my new SanDisk Ultra memory card and unable to do so. I'm currently using Adobe Photoshop CS4 Extended, is this the right one or do I need to update?

    …and you absolutely have to specify the camera model that generated those raw image files.
    2.—There's no such thing as "SanDisk images"
    3,— BOILERPLATE TEXT:
    Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • I need help trying to install 8.1.2 from 8.1.1? And update is for 8.1.2 only.Help please.

    Hello I hope some one will know what to do to help me out here!!! I have read most of the Post about 8.1.1 to try and download and upgrade to 8.1.2 and most of the ?'s don't have the answers the person needs to fix adobe on their computer befor they go MAD!!I have windows XP Home SP2 and all the other hi tech items on my computer. I got the update from adobe Automaticlly to download 8.1.2 and it went ok and I was using it when needed. But something else happened to my computer and I had to do a restore back a few days. And then I noticed I had adobe 8.1.1 and not the newer 8.1.2 that was just installed a few days befor. So I downloaded 8.1.2 manualy and adobe web page downloaded like 32Mbs of data. Then at the end of the download it said it could not install it.! And the end page that opened up did not have very much infomation to go on to fix the problem.? I hope some one can unsderstand what I'm saying? I can never get a hold of anyone at adobe to help. You can't find a email to tech support anywhere here? SO I don't dare uninstalling 8.1.1 and then go and try to download the new 8.1.2, because I read alot of people could not install 8.1.2 at all from the adobe reader 8.1.2 download page! Help

    Upgrading from iPhoto 8 to iPhoto 9 requires a purchase. There are two ways to get to iPhoto 9: 
    1 - purchase a copy of the iLife 11 disk from a 3rd party retailer like Amazon.com or eBay.com.
    2 - if your MBP meets the requirements upgrade you system for free to Mavericks.  Then you can purchase the latest iPhoto version, 9.5.1, from the App Store.
    OT

Maybe you are looking for