Handle LOCAL files during a web session

I'm developing an application with Forms 6i.
Please consider the following command line:
text_io.fopen('c:\tmp.txt','r')
In client/server mode the file "tmp.txt" is searched on the local computer (on
the client).
In web mode the file "tmp.txt" is searched on the server.
How can I open the "tmp.txt" file on the CLIENT computer, also in web mode?
Is there a way to handle local files during a web session?
Thank you in advance!

There is a java upload bean available on OTN (somewhere in the javabean/pjc section of examplecode) ... this one lets you do what you want, but it's violating the java sandbox functionality and hence need to be certified/signed to use in a browser - which i personally think is somehwat a hassle ... also it just copies the file to the middletier - you still will need to then read it from there.
i've found that using the webdb/portal approach for file handling is much easier. if you alerady run on web then you probably anyway have installed 9ias or a webdb/portal server somewhere ... using web.show_document builtin and a very small webdb procedure (something like 10 lines of code) will allow you to easily upload a file directly into the database into an blob!
have a search through this forum ... i posted a working example a few days back (somewhen last week) on this forum!
Cheers,
Stefan

Similar Messages

  • When handling local files , should I call flush() at all?

    When handling local files, I am confused by the flush() method.
    A lot of tutorial pages say it's safer to call flush() before close(). After thinking for a while, I'm asking mysel: Does flush() applies only to buffered stream(right?)? If a stream is not buffered, program should not call flush(). For buffered stream, the corresponding close() method of the wrapper or stream class should invoke flush() method. If they don't , it's an implementation bug, which should be fixed. So for both buffered and unbuffered stream, no need to call flush() before close()(right?).
    Then the question is: when do we need to call flush() method? If we don't need call flush() at all, why are there flush() methods in almost every stream/wrapper class?
    Please let me know what is wrong, either me or something else.
    Any feedback is appreciated.
    Gang

    "The close method of FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream." (Javadoc)
    By inheritance this also applies to BufferedOutputStream and its descendants. However FileOutputStream does not extend FOS or BOS so it has nothing to flush(), so flushing it does nothing at any time even before closing.
    In general flush() writes buffered bytes out of the JVM into the operating system. When you do have buffering, which in practice you should (e.g. new BufferedOutputStream(new FileOutputStream(...))), you should flush at points when you really want to be rid of the data. When operating on sockets you should always flush before try to read the next data from the socket. You can flush more often if you like but it is often counter-productive.

  • Open a local file from a web Service

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

  • [Info] Allow pkgbuild/makepkg to handle local files

    Hi there !
    As a fan of both Humble Indie Bundle and Archlinux,
    I found myself confronted with makepkg incapacity to locate local files.
    So i decided to write a dlagent for "file:" in makepkg.conf.
    As a side note, "local:" would be a better name, but aur/worldofgoo and aur/anomaly use "file:" so be it.
    It reads like this :
    DLAGENTS=( ...
    'file::/bin/ln -s $(zenity --file-selection --title="Select ressource %u" --file-filter $(basename %u)) %o')
    It simply opens a file browser displaying only files with a name matching the expected one, and then symlinks it to the build location.
    I am still usatisfied as it is possible to return a directory with a name not matching the pattern, but it seems impossible to prevent that with zenity.
    I wanted to share it with the community, but there is no wiki for makepkg.conf, so I ended up here ;-)
    Maybe it is even possible to include it by default (but then makepkg would depend on zenity, which is rater stupid).
    Any comment/improvement would be much appreciated.
    Layus
    Last edited by Layus (2012-10-29 18:24:39)

    Yes... I forgot that because building with yaourt is very interactive.
    1) ==> Select packages (numbers) to install :
    2) ==> Edit PKGBUILD ? [Y/n] (if yes edit, then same question again, until you refuse)
    3) ==> Edit readme.install [Y/n]
    4) ==> Start compiling <pkg> ? [Y/n]
    4') select tarball with zenity
    5) ==> Do you want to install <pkg> (or verify it)
    6) sudo : enter password for <user> :
    7) Proceed to install ? [Y/n] (pacman prompt)
    So inserting one interactive step seemed meaningless but of course makepkg is supposed to be fully automatic.
    So be it, this idea shall only stay here in case anyone searches for the same functionality.
    Thank you for the comment, and be sure I will continue to muck a lot

  • Retain variable values across web templates during a web session

    Hi all,
    How can we let web template get variable values from another template's variable values so as to keep the same entry values as previous report run?
    For example 0vendor has a variable (for single, mandory) used in all  vendor related web templates. "vendor1" was entered for the second template.
    I tried to use "SET/GET PARAMETER" in variable user exit. It works in BI with RSRT,  but it doesn't work with Bex or Web template. Looks like web session is not sync with the ABAP stack.
    How about using cookie? How to create/reset cookie in variable user exit? Can we get variable values from web server memory or user session data?
    Please share your thought !
    Thanks for helping!
    David

    Hi Arun,
    All the web templates are randomly run by user, there are no set of templates run after one template. Any templates can run after any other web template.
    Basically we link  web templates with portal menu items. any report can be run by any sequence. The thing the new report need to take the previous selection values from common variables.

  • Is there a way to open a local file not a web file with actionscript 3.0?

    Reason for asking is because I am making a media player in Adobe Flash CS6, and was wondering if there was anyway to make a button to open a local .fla file in a directory with ActionScript 3.0 or if there are any other ways I can achieve this?
    Thanks Casey

    with an air app, check the file class.  otherwise, check the filereference class.

  • How to get access to the local file system when running with Web Start

    I'm trying to create a JavaFX app that reads and writes image files to the local file system. Unfortunately, when I run it using the JNLP file that NetBeans generates, I get access permission errors when I try to create an Image object from a .png file.
    Is there any way to make this work in Netbeans? I assume I need to sign the jar or something? I tried turning "Enable Web Start" on in the application settings, and "self-sign by generated key", but that made it so the app wouldn't launch at all using the JNLP file.

    Same as usual as with any other web start app : sign the app or modify the policies of the local JRE. Better sign the app with a temp certificate.
    As for the 2nd error (signed app does not launch), I have no idea as I haven't tried using JWS with FX 2.0 yet. Try to activate console and loggin in Java's control panel options (in W7, JWS logs are in c:\users\<userid>\appdata\LocalLow\Sun\Java\Deployment\log) and see if anything appear here.
    Anyway JWS errors are notoriously not easy to figure out and the whole technology in itself is temperamental. Find the tool named JaNeLA on the web it will help you analyze syntax error in your JNLP (though it is not aware of the new syntax introduced for FX 2.0 and may produce lots of errors on those) and head to the JWS forum (Java Web Start & JNLP Andrew Thompson who dwells over there is the author of JaNeLA).

  • Transaction Locking during multiple Webservice - persistent webs sessions

    Hi All,<br>
    <br>
    Yesterday evening we had a discussion concerning ESA architecture. We want to create (web)services for accessing the SAP business objects (using XI) and use these (web)services via visual composer, webdynpro or custom java development.<br>
    <br>
    It does not seem a big problem to perform creations and reads of transaction, but when we want to change objects, we saw some problems concerning locking/commiting and rollbacks.<br>
    <br>
    From our GUI we would like to be able to go in edit mode and from that moment on, the transaction should be locked. We then want to change certain parameters and commit only when we push the save button.<br>
    <br>
    We can invoke a webservice wich tries to lock the transaction, but at the moment the XI scenario is completed (=the lock is created), the program at SAP side (=proxy in our case) is also finished and the lock is automaticly removed. How can we do locking, when using webservices via XI?<br>
    <br>
    The problem of the rollback and commit we can partially solve by putting more logic in the GUI, but we don't want to do that. How can we do a change of a business object and remember this change without doing a commit on the SAP system.... . Same problem for the rollback.<br>
    <br>
    Is there a away to keep a session "alive" during multiple webservice calls or to simulate it? Every webservice invokation happens in a different context...isn't it?<br>
    <br>
    <br>
    <b>Just to make it a bit more clear.</b><br>
    <br>
    Suppose we create 6 service related to the business object bupa (business partner).<br>
    - read<br>
    - change<br>
    - commit<br>
    - rollback<br>
    - lock<br>
    - unlock.<br>
    <br>
    We create a GUI which uses these services.<br>
    <br>
    <b>Step1:</b> we want to see bupa in detail, so the read webservice is called and the retrieved details are shown in the GUI<br>
    <b>Step2:</b> we want to go in edit mode, so the lock webservice is called to lock the bupa. The bupa should stay locked, untill the unlock is called. Here occurs the problem. The webservice lock is called, XI will trigger the proxy on the SAP system. This proxy will lock the bupa. As soon as the proxy-program is completed, the bupa lock will automaticly be removed ... . We want to keep this lock!<br>
    <b>Step3:</b> we change the bupa using the change webservice. Only the user who locked the bupa should be able to change it.<br>
    Problem concerning the locking occurs: standard we don't know who locked the bupa (this is done by the generic RFC user, configured in sm59). Should we pass some kind of GUID towards the proxy and build some additional logic to know which end-user in fact locked it... . Using the userid isn't sufficient, because a user could logon multiple time simultanously.<br>
    <br>
    Another problem is that we want to change the bupa, without having to do a commit yet.De commit should be called only when pushing the save button. When the proxy is ended and we did not do a commit, the changes are lost normally ... .<br>
    <br>
    What we in fact want to do is Simulate the bsp behaviour.<br>
    <b>Step4:</b>We want to perform a save of the things we changed or a reset. This means the commit or rollback webservice is called.<br>
    <b>Step5:</b> We want to unlock the bupa by calling the unlock webservice.<br>
    <br>
    <br>
    Please give me your comments.<br>
    <br>
    Kind regards<br>
    Joris<br>
    <br>
    Note: Transaction Locking during multiple Webservice "sessions".
    Message was edited by:
            Joris Verberckmoes

    There are multiple strategies how to resolve this. They require that the last change time is available in the changed object, and also that the client keeps the value of the change time when it read the data.
    1. First one wins
    Immediately before posting the changes, the current change time is read from the server. In case it is different from the client buffer, then the client changes are discarted.
    Example:
    1. Client A reads data
    2. Client B reads data
    3. Client B changes its buffer
    4. Client B checks if server change time has changed (result is no)
    5. Client B writes his changes to the server
    6. Client A changes its buffer
    7. Client A checks if server change time has changed (result is yes)
    8. Client A discarts its changes
    2. Last one wins
    Easy. Client just writes his changes to the server, overwriting any changes that might have occured since it read the data.
    Example:
    1. Client A reads data
    2. Client B reads data
    3. Client B changes its buffer
    4. Client B writes his changes to the server
    5. Client A changes its buffer
    6. Client A writes its changes to the server -> changes from client B are lost
    3. Everybody wins
    Most complicated. In case of concurrent changes, the client is responsible for merging his changes with the changes from other clients and to resolve any conflicts.
    Example:
    1. Client A reads data
    2. Client B reads data
    3. Client B changes its buffer
    4. Client B checks if server change time has changed (result is no)
    5. Client B writes his changes to the server
    6. Client A changes its buffer
    7. Client A checks if server change time has changed (result is yes)
    8. Client A merges its changes with changes from client B
    9. Client A writes his changes to the server
    "Last one wins" is definitely not water-proof. But even with the other strategies, data can potentially get lost in the short timeframe when the change time is checked and the actual update.
    To make it more secure, server support is required. E.g. the client could pass the change time from its read access to the server. The server can then reliably reject the update if the change data has been updated in beetween by another client.

  • Can Photoshop Elements version 13 handle raw files from Canon camera 7D mark 2? Where can I read about it on Adobe web site?

    Can Photoshop Elements version 13 handle raw files from Canon camera 7D mark 2?
    Where can I read about it on Adobe web site?
    I found an Adobe web site note that raw plug-in version 8.7 will support Canon 7D mark 2, but is not included in Elements version 11.

    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

  • CR 2008 dependence files cannot be found during the web setup project build

    Hi,
    Please anyone who knows why dependence files cannot be found?
    CR 2008 dependence files cannot be found during the web setup project build. Nevertheless, this problem did not prevent the project from being installed on the server but I need to know why it couldn't be found? while I'm having the latest service packs installed on my development machine (SP0, SP1, SP-Fix 1, 2, 3 and 4 including ClickOnce and Merge Modules).
    The warning messages that I'm getting during the web setup project build.
    Build started: Project: VMAComponentsLibrary, Configuration: Debug Any CPU
    Starting pre-build validation for project 'VMASetup'
    WARNING: Unable to find module dependency with signature 'MFCLOC.74FD3CE6_2A8D_0E9C_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'ATL.Policy.66332652_9C28_58B1_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'OpenMP.Policy.04B9F3B6_9645_7658_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'MFCLOC.Policy.D2730D3F_3C41_5884_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'ATL.97F81AF1_0E47_DC99_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'CRT.Policy.63E949F6_03BC_5C40_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'MFC.Policy.68B7C6D9_1DF2_54C1_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'MFC.9BAE13A2_E7AF_D6C3_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'CRT.98CB24AD_52FB_DB5F_FF1F_C8B3B9A1E18E'
    WARNING: Unable to find module dependency with signature 'OpenMP.1E507087_0819_45E0_FF1F_C8B3B9A1E18E'
    Pre-build validation for project 'VMASetup' completed
    Thank you.

    Hi,
    CR 2008 for VS has a merge module that will be copied to the C:\Program Files\Common Files\Merge Modules for example (CRRuntime_12_1.msm, CRRuntime_12_1_da.msm, CRRuntime_12_1_de.msm, u2026).
    According to CR documentation in order to deploy a project which uses a crystal reports we have to including one or more of these files in the setup project (Merge Modules).
    As I understand these files can help the setup project to know which dependence files are needed for the application to be deployed successfully with CR.
    You mentioned
    (The merge modules for Crystal Reports 2008 SP1 are dependent on the C++ library files from 2005 SP1.) I understood the above message.
    But what did you mean by this? What are the merge modules that you are mentioning hear?
    (I know this isn't what you want to hear but the merge modules just aren't available any other way. Microsoft doesn't have them available for download, and we are not permitted to make them available.)
    Thanks.
    Edited by: Sami Aljafer on Jun 15, 2009 9:37 PM

  • How do we create Hyperlink to local file on c:\ in Web Intelligence

    How de we create Hyperlink to local file on c:\ in Web Intelligence.
    Thanks in advance,
    K.

    K,
    You can't hyperlink to a local file when you are in WebI.  The ability to hyperlink requires the http protocol to be employed, wrapped within a web service (like IIS, for instance).  So to hyperlink to any file, that file must be a part of a web service, and the web service must have access to the folder (again, like in IIS you must create web shares and IIS must "mount" those shares in an http environment).  Hopefully I'm making sense to you on why it can't be done. 
    On the other hand, content that is static and has been made available for browsing on the web can also be linked to by populating a cell in a WebI report, marking that cell as "read cell contents as hyperlink", etc, etc.
    Thanks,
    John

  • Renamed Macintosh HD now Dreamweaver can't preview local files in Web Browser even though I have redefined local sites

    I've renamed my Macintosh HD on my Macbook something else-and
    then went in and redefined all the local sites in Dreamweaver CS3
    with the new name. Dreamweaver locates all the local files and
    allows me to edit and work on them-but then when I save and preview
    it can't locate the files. I've changed the name of my hard drive
    back to Macintosh HD and still the same problem. I'm completely
    stuck and this is frustrating the hell out of me-what do I
    do?

    If it is during the preview, check the test server
    information in the site settings.

  • I am having trouble moving files from iPhoto to a thumb drive.  Sometimes I can move 20 photos next time I can only move 2 photos or 0---this is during the same session.  I also have trouble downloading photos to the internet.  Can someone please help?

    I am having trouble moving files from iphoto to a thumb drive.  During the same session sometime I can move 10 photos at a time, the next time I can only move one photo and sometime no photos will move.  I also have trouble downloading photos to the internet.  I was using a MacBook Pro and had no problems like this.  I then upgraded to the MacBook Pro with Retina Vision and this is the computer I am having problems with.  Can anyone please give me a suggestion in how to fix this problem. THANK YOU.

    iPhoto problems should be posted in their forums.
    I also have trouble downloading photos to the internet.
    Needs clarification.  You upload from your computer to the internet & download from a website/internet to your computer.  So which are you trying to do?  Either way, sounds like a browser issue.  You need to post in the forum of whichever browser you are using.

  • Is the iweb that comes with your computer complete? I am not able to save to a local file or send to my web site.  Do I need to purchase the complete one?

    I have an IMAC 10.6.8
    Is the iweb that comes with your computer complete? I am not able to save to a local file or send to my web site.  Do I need to purchase the complete one?

    If you have iWeb V 3 you need to go to the Site Publishing Settings page...
    http://www.iwebformusicians.com/iWeb/Publish-Website.html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Help with best solution for file read/write in web app (not local files)

    Problem in a nutshell...
    I have an AIR app to process images..  organize and add information. This information is read and written to local XML files. This is working fine (if still a be messy... still learning this OOP stuff ;O)
    So... now I am developing my Web gallery app to consume these files for a web gallery (unique concept huh? ;O)
    Reading them in was easy with the Declaration block....
    <fx:Declarations>
    <fx:XML id="galleryXML" source="gaXML.xml"/>
    <fx:XML id="baXML" source="baXML.xml"/>
    <fx:XML id="prjXML" source="prjXML.xml"/>
    <s:XMLListCollection id="galleryList" source="{galleryXML.item}"/>
    <s:XMLListCollection id="baList" source="{baXML.item}"/>
    </fx:Declarations>
    But I want the owner to have a maintenance mode where information can be added/changed and saved back to the XML file on the server. I have read about all the different services available, but I am not that familiar with them. Also I will have no way of knowing what services the user will have available on their host. So... help me out in understanding what the most universal solution would be to be able to read and write XML files stored on the host along with the application.
    I hope that is clear enough, but ask away if any more details will help in the discussion.
    Thanks
    Bob Galka

    Hi Jeba,
    Whenever u are using *"Thread.currentThread().getContextClassLoader()"* Code inside your application means the Files (Resources) which you are looking right now must be poresent in the CLASSPATH...(Bootstrap classloader/ System ClassLoader/ Application ClassLoader/ Sub Module ClassLoader...).
    So when we place a resource (example XML or Properties file) inside the "WEB-INF/classes" directory then it means that file (resource) is available as part of the Module Classloader....So the above code getContextClassloader() will be able to find that resource easily.
    Thanks
    jay SenSharma
    http://middlewaremagic.com/weblogic (Middleware Magic Is Here)

Maybe you are looking for

  • Problem in Activation of Workflow

    Hi, We are using a workflow when we test the workflow through SBWP then we get activated version as 'X'. When we test  workflow through SWUS, we get activated version as 'Y'. Can any one tell us what can be the reason for the same. Regards, Sandeep G

  • BLOBs stored in DB

    I have some files stored in the DB (11g) as Blobs...mostly images but some PDFs. The files are uploaded using an upload webpage, into a table like: CREATE TABLE wpg_document (   NAME               VARCHAR(256)   UNIQUE NOT NULL,   MIME_TYPE         

  • Employee Photo Mass upload

    Hello, We are trying to upload Employee photos using FUnction Modulr ARCHIVE_CREATE_FILE it is working till we upgraded to patch level 55 after that it is giving Error_Archive What needs to be done Regards Chakravarthy Nalla

  • Datacopy command copied [0] source data blocks to [1073] target data blocks

    Hi, When I ran this particular script, datacopy command executed successfully but the values did not copied (Plan1 has values). Can you please suggest. Datacopy command copied [0] source data blocks to [10736] target data blocks SET UPDATECALC OFF; S

  • Adding french accents in MOTION

    How do I add accents in a MOTION text box...I want to add an acute e to a word and can't find the shortcut!!! Thanks in advance!