File Upload demo problem

Hi!, i have a problem with the File Upload Demo when it calls this line:
hDirectoryObject := JFile.new(directory);
and the error is: error 6508 "PL/SQL: could not find program unit being called"
That's ok, but anybody knows why should the program couldnt find the routine ?
And just one more thing...where can i look for JFile method description ??
Thanks a lot :) !!
Cristian.

Is this 9i or 6i?
JFile is an imported wrapper for a Java Class - it should be in the Demo form already - you could try a compile all on the file just in case.

Similar Messages

  • File Upload Demo Doesn't Work

    Applet loads & I can select the file to upload. However, once I have selected the file to upload there is a message that says "Encoding...." for just a split second and then the applet hangs. The "Encoding..." message window has a yellow banner across the bottom warning about using an applet window. I looked at the output in the Java console and the last 10 or 15 lines describe an "AppletSecurityException: checkread".
    Yes, I did register the certificate supplied with the demo. As far as I can tell, my classpath, path, & forms60_path are correct. At least I get no errors indicating that this is the problem.
    Could it be that Jinitiator is looking in the wrong certificate registry for the certificate?
    Please help! I'm about to give up on the upload bean and start looking for alternative solutions. If anyone out there was actually able to get the filr upload demo to work, please respond and help me trouble-shoot this.
    Thanks for any help you can give.

    Still having problems....
    I downloaded the Forms 9i demos. I copied the latest 9i UploadClient.jar and UploadServer.jar files into my \orant\forms60\java folder. I unjarred, rejarred, and signed them. I am running Jinitiator 1.3.1.9 on the client. When I first ran the form I got the "Duke" message asking if I should trust the signer (Myself) and I responded "always trust". However, the form didn't show display and it appeared to hang. So I copied the 9i classes into my \orant\forms60\java\oracle\demos\uploadclient & uploadserver folders (respectively). Now the form will display, but my Java console displays the following error and the form appears to hang immediately after loading.
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.misc)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
         at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
         at java.lang.ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivilege[i]Long postings are being truncated to ~1 kB at this time.

  • File Upload element Problem

    Hello All,
    We have a problem regarding the File Upload button in Webdynpro.
    when we upload a file using this element and goto another view and comeback, the upload element is not showing any filename.
    But when debugged, the fileupload context node still has the data. Just it is not showing in the UI.
    Is it an existing problem with File Upload? Or do we have to do anything to make the filename visible.
    Thanks,
    Anand

    Hi,
    this works as designed, see the section on browser details <a href="http://help.sap.com/saphelp_nw70/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm">here</a>
    Regards, Heidi

  • File upload demo application in 2.0

    Hi!
    I implemented the file upload application from the demo applications with the standard table HTMLDB_APPLICATION_FILES. It works very fine. Thanks for sharing this code.
    BUT I was unable to implement a custom table, because I could not locate the insert-function (as described in the tutorial). It is no known process on any of my pages.
    Could you help me finding it?
    (And is a file always stored as blob, or could it be a clob as well?)
    My main motive for this question is to gain inside knowledge in building some crude filerepository. We receive plain-ascii-data files via ftp and I have to import their data into a table.
    I do not want to go through all this 'reading OS-directory with java, opening files as external tables, moving them with utl_file', if I simply could
    a) receive the file directly as a clob in my table
    b) get the necessary data with sql
    c) handle all archiving, file renaming directly by updating a table
    Beside application express's file upload (speaking only http), the is a XML repository which 'speaks' ftp and http.
    Does someone have experience with uploading non-xml files and storing them as clobs?
    Thanks,
    Michael

    Hello Michael,
    I believe the reference in the demo tutorial is to Insert process (not function). This is probably the process defined on page 8-6, step 4a of the "Create a process to insert information" section.
    Basically you can upload and store files in CLOB. For my self, I only did it with XML files, but I don't see any reason not to do it with other types of files.
    I think that in order to work with non-structured files (like ASCII) you should learn more about Oracle Text. Apex is also using this product. Search this forum for "oracle text" and continue from there.
    Hope this helps,
    Arie.

  • File upload demo / call_form / exit_form

    I have the file upload bean demo form working properly. Now I want to open the fileupload form as a modal window.
    However, if I call the fileupload form using call_form then the application hangs after uploading a file and then exiting the fileupload form.
    If I open the fileupload form using the open_form command then the exit_form works fine.
    Why won't call_form allow me to exit_form without hanging the application?

    If you install the 9i demos from OTN, they include the fileupload sample and the installation does all the setup for you including the classpath etc.

  • File Upload / ENCTYPE Problem - Please HELP !!!!!!

    Please HELP !!!
    I have following config. MS Windows Server 2003 with
    Coldfusion 7. Everything is working fine.
    But now I want to upload a file, and there is the problem
    that I have the wrong content type on my action page, and so my
    form field "FileContents" is empty.
    On my action page i have got content_type
    "application/x-www-form-urlencoded" instead of
    "multipart/form-data".
    Here is the code:
    --------------------uploadfileform.cfm--------------------
    <cfoutput>
    <form enctype="multipart/form-data" method="post"
    action="uploadfileaction.cfm" name="uploadForm" id="uploadForm">
    <input name="FileContents" type="file"
    id="FileContents">
    <br>
    <input name="submit" type="submit" value="Upload File">
    </form>
    </cfoutput>
    --------------------uploadfileaction.cfm--------------------
    <cffile action="upload" fileField="FileContents"
    destination="e:\tempdir" nameConflict="MakeUnique">
    If there is anyone who can help me please be so kind and tell
    me the solution.
    Kind Regards!

    On my action page i have got content_type
    "application/x-www-form-urlencoded" instead of
    "multipart/form-data".
    There is no need for that sort of thing on the action page.
    On the action page the cffile tag is enough.
    Everything else seems to be all right, except one. The
    destination attribute should end with a back-slash. The correct
    value is
    destination="e:\tempdir\".

  • File Upload -- MultipartRequest Problem

    I use com.oreilly.servlet.MultipartRequest to upload files through a servlet.
    This works fine, but when the size of a file exceeds the maximum size,
    I need to handle the IOException but it doesn't work.
    here is the code:
    try {
    if (file != null) {
    File outputFile = new File(fullPath,fileName);
    FileInputStream inFile = new FileInputStream(file);
    FileOutputStream outFile = new FileOutputStream(outputFile);
    while (inFile.available()>0) {
    outFile.write(inFile.read());
    inFile.close();
    outFile.close();
    return (fileName);
    catch( java.io.IOException e ) {
    System.out.println("DiskFileUpload write failed" + e.toString());
    return (null);
    catch ( java.lang.Exception le) {
    System.out.println("DiskFileUpload write failed" + le.toString());
    response.sendRedirect("error.html");

    What is the problem you are getting?
    Are you getting Page Cannot displayed Browser page?

  • (JSP/SERVLET) File upload Character problem form enctype="multipart.....

    Hi,
    When i upload a file from <form> ( jsp page ) and send it to my object class(struts,servlet) , the filename �����.doc are replaced by ?????.doc. in the database.
    I make few test by adding UTF-8 charset and content type to the jsp but still doesn't work...
    Ex :
    String encod = request.getCharacterEncoding();
    if (encod == null || !encod.equals("UTF-8"))
    try
    request.setCharacterEncoding("UTF-8");
    catch (UnsupportedEncodingException e)
    System.err.println("HttpMultipartRequest - : " + e);
    It's not a charset problem in the database because i try to do with an input type="text" and its working. It's just not working with the input type="file".
    And i also add directly ��� character into the database and its working.
    it's will be a pleasure if someone could response to me .
    thanks
    Jonathan

    warnerja,
    Not sure why you always play the part of the
    cross-post police... Seems like waste of effort to
    me.To each his own. I'm not sure why you feel the need
    to question my motives. Also not sure why you have
    posted requests to Sun regarding forum features...
    "Seems like a waste of effort to me.". But I wasn't
    going to call you on it.touch�
    :-)

  • File Upload/Download Problem

    Hi,
    I have a fileupload button. The attributes type is XSTRING, which i bound it with "data" property of download.
    When i download this file with "download" element, it comes in a zip file and as XML files. Only the jpg files are downloaded correctly.
    How can i solve this?
    Thanks.

    Hi,
    I am so sory for my very late answer.
    If you want to upload/download files, you should have a node which includes attributes
    (attribute names are just example ):
    1) filename(type: for example afilename),
    2)mimetype (type : string),
    3) file(type : a data element with type 'RAWSTRING').
    You must match your fileupload element's attributes with them:
    "DATA" attribute --> file ,
    "fileNAME" attribute--> filename,
    "mimeTYPE" attritube -->mimetype.
    When you want to download this file, you should put a filedownload element and match this element's attributes with the node's attributes which i described above.

  • File Upload Concept Problem

    Hi, I am writing a WAS4 webapp which will allow users to upload files to the WAS machine. I've written and deployed apps on WAS4 before and I create a war file and deploy it via the admin console. But something I don't quite understand is that if I create a folder, say 'upload' underneath my context root such that the path is /contextRoot/upload and this folder is inside the war file, can a user upload into this folder?
    If not, then where must I place the folder in order to perform uploads and how can I reference this folder from my java code? Do I give it absolute machine paths, or some other sort of context relative path?

    Did you try using Jakarta FileUpload? It will answer all your questions.
    http://jakarta.apache.org/commons/fileupload/using.html

  • File upload component problem

    hi,
    When i use fileupload component in my page, Turkish characters is not renderind and i see them as question mark. Changing page encoding is not working and solving my problem, too.
    any suggestion would be appreciated.
    Regards...

    I got exact the same problem, but with Chinese characters display. Does that means we can only use upload with English characters? Any solutions in the future?
    Thanks,

  • File Upload Demo not working

    I downloaded the source for this from OTN for 6i & recompiled the forms & libraries in 9i & tried to run after following all the steps mentioned in the readme doc but the form does not show up, the jinitiator java console window shows loading f90all...jar file & UploadClient.jar.sig file & stops
    i have registered PJC using JavaKey as mentioned in the doc & also set the class path in the default.env file pointing to orahome/jdk/jre/bin/classic.
    Would any one throw light on what has gone wrong???
    Mahesh

    If you install the 9i demos from OTN, they include the fileupload sample and the installation does all the setup for you including the classpath etc.

  • Getting extra things in the uploaded file by flex file upload

    Hi,
    I am working on a application where I am using adobe flex. I
    have a requirement wher I have to upload file to the server. System
    allows user to browse file from local machine and flex uploads it
    to the server.
    Now there is a upload url, its a jsp page which gets
    mutipart/form-data content from the request, opens an outputstream
    and writes the content of the inputstrem to the file.
    fileUpload.mxml
    quote:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical" creationComplete="initApp()">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.utils.ObjectUtil;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;
    private var fileRef:FileReference;
    private function initApp():void {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.CANCEL, traceEvent);
    fileRef.addEventListener(Event.COMPLETE, completeEvent);
    fileRef.addEventListener(Event.SELECT, selectEvent);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR, traceEvent);
    fileRef.addEventListener(Event.OPEN, traceEvent);
    fileRef.addEventListener(ProgressEvent.PROGRESS,
    progressEvent);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    traceEvent);
    private function traceEvent(event:Event):void {
    var tmp:String = "================================\n";
    //ta.text += tmp + event.type + " event:" +
    mx.utils.ObjectUtil.toString(event) + "\n" ;
    //ta.verticalScrollPosition += 20;
    private function ioErrorEvent(event:IOErrorEvent):void{
    Alert.show("IOError:" + event.text);
    traceEvent(event);
    private function selectEvent(event:Event):void{
    btn_upload.enabled = true;
    traceEvent(event);
    filename.text = fileRef.name;
    progressBar.setProgress(0, 100);
    progressBar.label = "Loading 0%";
    private function progressEvent(event:ProgressEvent):void {
    progressBar.setProgress(event.bytesLoaded,
    event.bytesTotal);
    traceEvent(event);
    private function completeEvent(event:Event):void {
    progressBar.label = "Complete.";
    filename.text += " uploaded";
    traceEvent(event);
    btn_upload.enabled = false;
    btn_cancel.enabled = false;
    private function uploadFile(endpoint:String):void {
    var param:String = "author=" + ti_author.text;
    var req:URLRequest = new URLRequest(endpoint);
    req.method = URLRequestMethod.POST;
    fileRef.upload(req, param, false);
    progressBar.label = "Uploading...";
    btn_cancel.enabled = true;
    ]]>
    </mx:Script>
    <mx:Panel title="Flex 2 File Uploading Demo" width="100%"
    height="100%" >
    <mx:Form>
    <mx:FormItem label="Upload URL:">
    <mx:TextInput editable="false" id="uploadURL"
    width="100%" text="
    http://localhost/flexApp/jsps/upload.jsp"
    enabled="true" />
    </mx:FormItem>
    <mx:FormItem label="Selected File:">
    <mx:Label id="filename"/>
    </mx:FormItem>
    <mx:FormItem label="Upload By:">
    <mx:TextInput id="ti_author" text="Author" />
    </mx:FormItem>
    <mx:FormItem direction="horizontal" width="100%">
    <mx:Button width="80" label="Browse"
    click="fileRef.browse()" />
    <mx:Button width="80" label="Upload" id="btn_upload"
    enabled="false" click="uploadFile(uploadURL.text)" />
    <mx:Button width="80" label="Cancel" id="btn_cancel"
    enabled="false" click="fileRef.cancel()" />
    </mx:FormItem>
    <mx:HRule width="100%" tabEnabled="false"/>
    <mx:FormItem label="Progress:">
    <mx:ProgressBar id="progressBar" mode="manual" />
    </mx:FormItem>
    </mx:Form>
    </mx:Panel>
    </mx:Application>
    test.jsp page
    quote:
    InputStream is = null;
    BufferedInputStream bis = null;
    BufferedOutputStream bos = null;
    try {
    System.out.println("request.getContentType()...." +
    request.getContentType());
    is = request.getInputStream();
    bis = new BufferedInputStream(is);
    bos = new BufferedOutputStream(new FileOutputStream(new
    File("d:/naseem.txt")));
    int i=0;
    while ((i = bis.read())!=-1) {
    bos.write(i);
    bos.flush();
    catch(Exception e){
    e.printStackTrace();
    finally{
    try{
    if(bos!=null && is!=null && bis!=null){
    bos.close();is.close();bis.close();
    }catch(Exception e){e.printStackTrace();}
    Above jsp writes the content of browsed file to d:/naseem.txt
    Problem which I am facing is besides the actual content, it
    also write something else.
    Actual file:
    quote:
    My Text
    upload txt file which I got: naseem.txt
    quote:
    ------------cH2ei4GI3ae0KM7cH2GI3ei4ae0cH2
    Content-Disposition: form-data; name="Filename"
    test.txt
    ------------cH2ei4GI3ae0KM7cH2GI3ei4ae0cH2
    Content-Disposition: form-data; name="author=Author";
    filename="test.txt"
    Content-Type: application/octet-stream
    My Text
    ------------cH2ei4GI3ae0KM7cH2GI3ei4ae0cH2
    Content-Disposition: form-data; name="Upload"
    Submit Query
    ------------cH2ei4GI3ae0KM7cH2GI3ei4ae0cH2--
    My question is how do I remove these content-disposition,
    content type i.e., extra things from my file. I need only content
    to be written in the file.
    Regards,
    Naseem

    Hi Naseem,
    You need a multipart request parsing utility. Check commons-fileupload for example.

  • 9i File Upload not working on remote machine

    Hi.
    The 9i File Upload demo utility is working fine when I invoke it locally on the same machine.
    Remotely, however, I just get a grey blank screen in the browser with the message "Applet initialized" in the status bar. The java console says that the two JAR files were downloaded successfully, and doesn't show any other error.
    When I imported the cert on the client, the expiry date had already passed (sometime in 2002). I have generated a new cert, resigned the JAR file and installed it in the correct directory. Again, the upload works fine locally, but not remotely.
    Has anyone any idea what could be wrong? I'd be very grateful for any assistance. For info, we're using 9iDS 9.0.2.1.
    Thanks,
    Peter

    Please ignore my previous message.
    I rebooted the client and it now seems to work fine.
    Thanks anyway,
    Peter

  • FILE UPLOAD PROBLEM SHOWING THE CONTENTS IN THE SAME BROWSER WINDOW

    Hi,
    This is amit Joshi
    I have uploaded content using input tag of type file and posted to jsp as multipart/form-data type
    in that jsp i am using following code to display the content in browser but only first content is displayed How can i modify it to show all content in the file ..
    <html>
    <head>
    <title>File Upload Display</title>
    </head>
    <body>
    <%
    //ServletOutputStream sout=response.getOutputStream();
    StringBuilder strBuilder = new StringBuilder();
    int count=0;
    String f;
    f=request.getParameter("filedb");
    DBManager dbm = new DBManager();
    //dbm.createTable("mms3");
    //log.info("In JSP : "+ f);
    //dbm.insert_data(f,"mms3");
    %>
    <%
    if (ServletFileUpload.isMultipartContent(request)){
    ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
    List fileItemsList = servletFileUpload.parseRequest(request);
    strBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>").append('\r').append('\n').append("<xpage version=\"1.0\">").append('\r').append('\n');
    String optionalFileName = "";
    FileItem fileItem = null;
    Iterator it = fileItemsList.iterator();
    ServletOutputStream outputStream=null;
    while (it.hasNext()){
    FileItem fileItemTemp = (FileItem)it.next();
    if (fileItemTemp.isFormField()){
    %>
    <b>Name-value Pair Info:</b>
    Field name: <%= fileItemTemp.getFieldName() %>
    Field value: <%= fileItemTemp.getString() %>
    <%
    if (fileItemTemp.getFieldName().equals("filename"))
    optionalFileName = fileItemTemp.getString();
    else
    fileItem = fileItemTemp;
    if (fileItem!=null){
    String fileName = fileItem.getName();
    %>
    <b>Uploaded File Info:</b>
    Content type: <%= fileItem.getContentType() %>
    Field name: <%= fileItem.getFieldName() %>
    File name: <%= fileName %>
    <%
    if(fileItem.getContentType().equals("image/jpeg")) { %>
    File : <p><%
         //response.setContentType("image/gif");
         byte[] bArray=fileItem.get();
         response.setContentType("image/jpeg");
         outputStream=null;
         outputStream= response.getOutputStream();
         outputStream.write(bArray);
         outputStream.flush();
         outputStream.close();
    else if(fileItem.getContentType().equals("text/plain"))
         %> File : <%= fileItem.getString() %>
    <%
    byte[] bArray=fileItem.get();
    response.setContentType("text/plain");
         outputStream = response.getOutputStream();
         out.println();
         outputStream.write(bArray);
         outputStream.flush();
         outputStream.close();
    %> </p> <%
    %>
    </body>
    </html>
    Edited by: Amit_Joshi on Nov 13, 2007 10:58 PM

    Well Well Well..
    That would not work...
    What you have to do is save the uploaded file content on to a location and then pass the fileName as a request parameter to a deidicated which displays the contents of that file.
    Just as an example
    <html>
    <head>
    <title>File Upload Display</title>
    </head>
    <body>
    <%
    //ServletOutputStream sout=response.getOutputStream();
    StringBuilder strBuilder = new StringBuilder();
    int count=0;
    String f;
    f=request.getParameter("filedb");
    DBManager dbm = new DBManager();
    //dbm.createTable("mms3");
    //log.info("In JSP : "+ f);
    //dbm.insert_data(f,"mms3");
    %>
    <%
    if (ServletFileUpload.isMultipartContent(request)){
    ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());
    List fileItemsList = servletFileUpload.parseRequest(request);
    strBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>").append('\r').append('\n').append("<xpage version=\"1.0\">").append('\r').append('\n');
    String optionalFileName = "";
    FileItem fileItem = null;
    Iterator it = fileItemsList.iterator();
    ServletOutputStream outputStream=null;
    while (it.hasNext()){
       FileItem fileItemTemp = (FileItem)it.next();
    %>
    Name-value Pair Info:
    Field name: <%= fileItemTemp.getFieldName() %><br/>
    Field value: <%= fileItemTemp.getString() %><br/>
    <%
    if (fileItemTemp.getFieldName().equals("filename"))
        optionalFileName = fileItemTemp.getString();
    if(!fileTempItem.isFormFiled()){
       String fileName = fileItem.getName();
       fileItem.write(optionalFileName);
    %>
    Uploaded File Info:
    Content type: <%= fileItem.getContentType() %><br/>
    Field name: <%= fileItem.getFieldName() %><br/>
    File name: <%= fileName %><br/>
    <%
    if(fileItem.getContentType().equals("image/jpeg") || fileItem.getContentType().equals("image/pjeg")) {
    %>
      <img src="FileServlet?fileName=<%=optionalFileName%>"   
    <%
    %>
    </body>
    </html>a sample code snippet for FileServlet.
    String fileName =  request.getParameter(fileName);
      File file = new File(fileName);
       if(!file.exists())
         return;
      // If JSP
      String mimeType = application.getMimeType("fileName");
           If you are using servlet
           String mimeType = this.getServletContext().getMimeType(fileName);
         response.setContentType(mimeType);  
         response.setHeader("Content-Disposition","inline;filename=\\"+fileName+"\\");
      BufferedOutputStream out1 = null;
      InputStream in = null;
      if(mimeType == null)
         mimeType = "application/octet-stream";
      try{
         in = new FileInputStream(f);
         response.setContentLength(in.available());
         BufferedOutputStream out1 = new BufferedOutputStream(response.getOutputStream(),1024);
         int size = 0;
         byte[] b = new byte[1024];
         while ((size = in.read(b, 0, 1024)) > 0)
            out1.write(b, 0, size);
      }catch(Exception exp){
      }finally{
          if(out1 != null){
             try{
                out1.flush();               
                out1.close();
             }catch(Exception e){}
          if(in != null){
            try{in.close();}catch(Exception e){}
      } Hope that might answer your question :)
    However,this is not the recommended way of doing this make use of MVC pattern.Would be a better approach.
    you might think of googling on this and can findout what is the best practise followed for problems of this sort
    REGARDS,
    RaHuL

Maybe you are looking for

  • [solved] Xorg 1.8.1 + FGLRX Mouse and keyboard don't work...

    Beginning this week i installed Arch linux for the first time (several times infact) and i followed the installtion guide to get gnome working on my machine... pacman -Sy pacman -S xorg pacman -S gnome gnome-system-tools gnome-extra gdm gksu I also a

  • Wifi WEP password not working on Windows side, works fine on Mac side

    I have not been able to get connected to my wireless connection with windows xp however I have no problem on the mac side. The problem is that my password is 12 characters (not 13). This WEP password works fine on the mac side and also works fine on

  • Only main user works....?

    Only the main user works, all the other are very slow, and the Macintosh HD and the icons on the finder do not show up. I can open programs but cant close them or it freezes, and whenever I try to relaunch the finder it freezes. I tried to delete all

  • If I Move iPhoto Library to External Drive Does It Keep Organized?

    Can anyone tell me: In iPhoto 09 8.2.1 if I take the time to organize, edit, "faces" "events" etc...and I move iPhoto to an External Harddrive, a Western Digital "My Book"...Does moved library stay edited, organized face tagged, etc? Thanks

  • Media Encoder will not update

    When in PPro CS5, I go to export media and I get a popup that says there is a Media Encoder update available for this version of PPro.  It says to check in Updates or to download the update.  When I check the updates, it says my software is up to dat