Write Access to a file in Tomcat server via J2me Midlet

How to make write access to a file using midlet and HTTP connection?
I have text file in the Tomcat server and I am able to read it with HTTP connection using emulator, but don't have idea how to make write access to the file. I'd like to write some text to the file.

Thanks, but could you be more accurate. What methods should I use in the servlet and what methods in the midlet?
Some links which concern this subject, would be nice too. I have tried with google, no success.

Similar Messages

  • Two VMs and exclusive write access to one file

    How can one guarentee exclusive write access to a file when two vms want to write to it?
    I looked at
    http://developer.java.sun.com/developer/JDCTechTips/2003/tt0304.html#2
    However, I am not sure whether a race condition could happen or not.
    (I thinking like:
    if file is not writable, change to writeable,
    else if file is writable, wait for a while and check again.
    write what you want
    change file back to not writeable.
    Is there some OS level exclusive access thing we can take advantage of? The follow up question would be, what about system crashes?
    Thanks.

    The problem with what you describe is that two JVMs
    could discover the file is not writeable at the same
    time, and then change it to writeable. You need some
    sort of action which can only be successfully
    completed by one JVM. Here's an idea:
    Create a dummy file which represents a "lock" (only
    one JVM may hold the lock). When a JVM wants the
    lock, it attempts to delete the file. This can only
    succeed for one JVM. Once you have the lock, you do
    your business and then restore the file.http://java.sun.com/j2se/1.4/docs/api/java/io/File.html#delete()
    not bad. It's a false situation too.
    However, deadlock can happen if the other VM goes down while the lock is taken.

  • How to connect to MS Access from servlet uploaded in TOMCAT server

    Hi,
    I want to access MS Access from servlet .I use TOMCAT server.I want to know what should i do.How to get drivers and how to set class path for them.
    Please help me in finding the solution
    thanks and Regards

    HI,
    try this
    <Code>
    response.setContentType(CONTENT_TYPE);
         PrintWriter out = response.getWriter();
         java.sql.DatabaseMetaData dm = null;
         java.sql.ResultSet rs = null;
         try
              Class.forName("sun,jdbc.odbc.JdbcOdbcDriver");
              Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:dsnName","","");
              dm = con.getMetaData();
              out.println("<html>");
              out.println("<head><title>Servlet1</title></head>");
              out.println("<body bgcolor=\"lightblue\">");
              if(con!=null){
                   dm = con.getMetaData();
                   out.println("<B><br>Driver Information</B>");
                   out.println("\n\t<br><br>Driver Name: "+ dm.getDriverName());
                   out.println("\n\t<br>Driver Version: "+ dm.getDriverVersion ());
                   out.println("\n\t<br>Database Information ");
                   out.println("\n\t<br>Database Name: "+ dm.getDatabaseProductName());
                   out.println("\n\t<br>Database Version: "+ dm.getDatabaseProductVersion());
                   out.println("\n\t<br><br>Avalilable Catalogs ");
                   rs = dm.getCatalogs();
                   while(rs.next()){
                             out.println("<br>\tcatalog: "+ rs.getString(1));
                   out.println("\n\t<br><br>conURL =" + conURL);
                   out.println("\n\t<br><br>Title = Database");
                   rs.close();
                   rs = null;
                   con.close();
              }else {
                   out.println("Error: No active Connection");
         }catch(ClassNotFoundException e) {
              out.println("Coudn't laod the database driver: " + e.getMessage());
         } catch(SQLException e) {     
              out.println("SQLException caught: " + e.getMessage());
              try {
                   if (con != null)
                        con.close();
                   if (rs != null)
                        rs.close();
              catch (SQLException ignored) {}
              finally {
                   try {
                             if (con != null)
                                  con.close();
                             if (rs != null)
                                  rs.close();
                        catch (SQLException ignored) {}
    </Code>
    Sachin

  • Authorization for the user to write/read/create a file in application serve

    Hi experts.
    I am uploading some data to a file in a folder in application server, created in AL11 tcode.
    In my program i need to restrict the unauthorized users to create/write/read a file in app server.
    I dont know how to do this.
    Kindly give me the code, please it wil be helpfull for you all.
    I dont know how to use the auth object or function module, to do this.
    Is the basis/security people need to do something.
    Kindly revert me back ASAP.
    KK

    Or use AUTHORITY_CHECK_DATASET function module before the open data set
    This function module allow you to check the user's authorization to access files (with the key words OPEN DATASET, READ DATASET, TRANSFER and DELETE DATASET). A check should be performed before opening a file.
    The authorization check is performed uwing the authorization object S_DATASET.
    Description of function parameters:
    PROGRAM: Name of the ABAP/4 program that contains the file access. If no program name is specified, the system assumes the current program.
    ACTIVITY: Access type. The possible values are:
    READ: Read file
    WRITE: Change file
    READ_WITH_FILTER: Read file with filter function
    WRITE_WITH_FILTER: Change file with filter function
    DELETE: Delete file
    FILENAME: Name of accessed file
    Example
    Notes
    The values to be passed as the ACTIVITY are defined as constants in the TYPE-POOL SABC.

  • How can I deny write access to datalog files for all but one process in LV8?

    In LabVIEW 7.1, wiring the deny mode terminal of Open File.vi with a Deny Write Only enum constant was an effective means for ensuring that only one process could write to a datalog file at a time.  In LabVIEW 8.0, Open File.vi is no longer available and the new Open/Create/Replace Datalog vi does not provide a deny mode terminal.  Also, the new Deny Access vi does not support datalog files.  Furthermore, the Set Permissions vi is an unsatisfactory solution because under the Windows operating system, it simply sets the Read Only file attribute.  This is inadequate because I have demonstrated that it is still possible for two processes to open a datalog file with read/write access before either one has had a chance to set the Read Only file attribute in order to lock out the file.  If a process sets the Read Only file attribute first, then it can't open the file with read/write access for itself.
    Does anyone understand the file mechanism by which deny mode used to work with the old Open File.vi?  I wish to restore the functionality I had in LV 7.1 in my LV 8 programs.
    Thanks!
    Larry

    Larry Stanos wrote:
    I appreciate the
    empathy from Rolf, but I'm hoping that someone may have written one or
    more vi's containing CINs that call Windows 2000/XP file access control
    library routines.  At least I'm assuming that is how the deny mode
    input to Open File.vi used to work in LV7.1.  The Microsoft
    Developers Network on-line documentation on Access Control http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/access_control.as... is
    daunting to put it mildly.  But even if a set of CINs has not
    already been coded, perhaps someone could point me to the specific set
    of calls I need to make to absolutely guarantee that no two
    clients can simultaneously open the same file with write privileges.   Unfortunately
    the elimination of deny mode functionality for datalog files in
    LV8 has sabotaged my commitment to a March 1 release date because it
    would also be impractical to convert everything back to LV7.1 at
    this point.   Sincere thanks to anyone who can help me out here!
    Unfortunately
    the functionality you mention does not work in the way the deny mode in
    the LabVIEW nodes works. Basically that deny mode is converted to an
    according FILE_SHARE_READ/FILE_SHARE_WRITE value and passed to the
    Win32 API CreateFile function. This is more or less the only place
    where you can define a global share (or deny) access to a file. That is
    also why the Deny Access node online help is talking about that the
    file is reopened.
    But I just retried what you had tried to do, and low and behold it
    works with wiring a datalog refnum to Deny Access. What is important
    here however is that you do need to wire a datatype to the record type
    input of the Open/Create/Replace Datalog node. Otherwise you can't
    connect the resulting datalog refnum to any other file function, since
    it is an incomplete datatype.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Restoring an ms access database backup file in sql server 2005

    Hello everyone.
    I have an ms access database backup file.
    Presently i dont have ms access database in  my system.
    It is high priority to access that ms access database backup file. 
    So, is there anyway to access that in sql server?
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.

    Hello sir,
    i tried to use import/export wizard to import data from an ms access backup file.
    I completed it with some warning's.
    Wizard has shown that 2 out of three objects(tables and views) are copied to destination database(empty database which i have created for storing this imported data).
    And in that process, wizard made me to create a package.
    Now how to access that package?
    And my newly created database has no data.(i mean it is supposed to have 2 objects which are copied from source right?)
    Sorry if my doubt looks silly i have never used ssis or import/export ever before.
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.

  • How to attach a file to tomcat server using SERVLETS

    Hello friends,
    I want to enable users to attach a file and send it to my server. This is a very common feature seen anywhere like e-mail attachments.
    Iam using tomcat server. I tried HTTP put but it did not work.
    Please give some suggessions.
    Thanks
    Goldy

    check this url:
    http://www.servlets.com/cos/index.html
    follow the link MultiPartRequest
    Spieler

  • Error trying to write to a measurement file and then send via gmail.vi

    So as the title says, I have a VI which is writing to a tdms file, and I want to send the file by gmail once the program has completed it's run. I downloaded gmail.vi and am integrating it into my existing code. Both my original code and the gmail VI work fine on their own, but when I try to have the combined VI send the data file by email, I get the error message that I've attached.
    Basically, it seems like the .tdms data file is in use by the measurement code, and I need to know how to free it up so that the gmail code can attach and send it.
    I've attached the main code as well as my modified gmail VI, so hopefully someone can take a look at tell me what I'm missing.
    Any help is much appreciate!
    Attachments:
    Error.PNG ‏19 KB
    PID Controller - Cleaned Up.vi ‏239 KB
    Email Alert.vi ‏19 KB

    While I can't view all of your code because it is missing several SubVIs, I have a good idea of what you are trying to do. I believe the culprit is the "Write to measurement file" express VI. Near as I can tell the original reference to the TDMS file is being held open inside the express VI. Here's a good general rule for using Express VI's: when you see them, RUN THE OTHER WAY! I say because there is almost always a significant amount of code in there that is unnecessary, In this case, you simply need the Open TDMS file, Write to TDMS, Close file functions; you do not need all of the extra code that is in the express VI's.
    <edit> P.S. I hope the username/password in Email alert.vi is a placeholder otherwise you just gave every idiot with access to LabVIEW your username and password to the account.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • Urgent : Download file from Application Server via Process Chain.

    Hi Experts,
    My requirement is to download the file from Application Server to local work station using an ABAP Program .
    I want including the above ABAP program in a process chain to execute  the program daily,
    I tried to use ARCHIVFILE_SERVER_TO_CLIENT and GUI_DOWNLOAD but unfortunately both the above FM doesn't support to run through Process chain.
    Can any one of you help me to send the code which selects a file from application server, downloads to local system and deletes it.
    Thank you very much for spending your precious time in this regard.

    Hi Sailekha,
    Regarding your case ..
    I suggest you to create the program where it run this function: WS_DOWNLOAD.
    After it, the program is run by your process chain.
    Hopefully it can help you a lot.
    Regards,
    Niel.
    thanks for the points you choose to assign.

  • Problem in accessing the media files from another server

    Currently I am working in a project with streaming video on demand and using FMS 4.5.
    Let’s say the FMS is installed on one machine say ‘121.123.35.34’ and there is another server ‘100.54.88.222’ where all the media files belong. Now we need to point to this third server to play videos from FMS.I have done the below changes:
    In the fms.ini file: set the VOD_DIR2 = \\100.54.88.222\myvideos
    In the application.xml: Added the stream: <Streams>/hr;${VOD_DIR2}</Streams>
    From my application accessing the path of flv as:source= “rtmp:// 121.123.35.34:1935/vod/hr/test” . Not able to access the video.
    Note: If I will point to say ‘C:hrvideos’ in VOD_DIR2, then I am able to access the videos using the same URL.
    I also tried mapping the shared path to the FMS machine and then given the mapped drive path in the VOD_DIR2, but this also doesn’t work.
    Please let me know:
    If we need to configure any other parameter to stream videos from another server.
    VOD_COMMON_DIR: I modified this similar TO VOD_DIR to location 'C:hrvideos', I am able to stream the videos using rtmp, but not abl eto stream with http.
              Please let me know  can we stream using http also as we need this to run f4m manifest file.
              http://121.123.35.34:8134/vod/hr/sample.mp4.
              http://121.123.35.34:8134/vod/hr/sample.f4m
    Thanks,
    Anjali

    Hi Shiven,
    I followed the steps suggested by you:
    1) Changed the stream:
    <Streams>/hr;${VOD_DIR2}</Streams> to<Streams>/;${VOD_DIR2}</Streams>
    But not able to access the video with rtmp:// 121.123.35.34:1935/vod/test
    2) For http streaming, changes the HttpStreamingContentPath in hds-vod in the httpd config file, and tried to stream the video like:
    http:// 121.123.35.34:8134/vod/test.mp4 or
    http:// 121.123.35.34:8134/hds-vod/test.mp4
    But not able to load the video.
    Please suggest?
    Thanks & Regards,
    Anjali Rawat

  • I can't access a shared file on remote server

    I can connect to a windows 2003 server through the VPN but I can't find the shared folder any where? I can see the Printers and fax machine through the web browser. I've only had my mac for a week but I really need to get to my work files!

    I find it astonishing that you can see remote printers and fax machines through your web browser, but that's a different issue.
    Even though you're on the VPN and connected to the office network, there is no support for auto-discovery over the VPN connection. In other words, the OS won't go out and look for available servers/shares in the VPN network.
    In order to connect to remote shares you'll need to know the server and share name which you can then enter into the Finder's Go -> Connect to Server dialog in the form smb://server/sharename (assuming you're using SMB servers in the central office).

  • Could not open the project file with write access. The file may be locked or you may not have permission to write to this location

    Keep getting this message if i try to open a file from an Network Drive. It only appears with adobe Premiere

    Not designed to do what you want on a network, so may or may not work properly... copy your files to a local hard drive for editing and back to network when done
    Some/all? versions of Premiere do not work properly, if at all, over a network
    -see messages #1 and #3 in http://forums.adobe.com/thread/771151
    -you MUST give all users administrator accounts to use Premiere
    -and especially Encore dual layer http://forums.adobe.com/thread/969395
    -#5 Server 2008 is UNsupported http://forums.adobe.com/thread/851602
    -a work around, of sorts http://forums.adobe.com/thread/957523
    -and not on a "domain" http://forums.adobe.com/thread/858977
    -http://helpx.adobe.com/premiere-pro/kb/networks-removable-media-dva.html

  • Sharing file paths on server via email

    Basic question,
    using either Entourage or Mail.app is it possible to provide a hyperlink to a document located on a leopard server share?
    thanks

    Hello,
    Yes, this can be done using a copy path application. I did not like the ones i saw on the internet, so I had one of our programmers write a custom one for us. We drop it as a custom button on the finder toolbar of the window, and users select the file and hit the buttton, which copies the path to the clipboard. They then paste it to an email. Below is an example of what the path looks like in email... That is an AFP URL that Mac can read when connected to an AFP fileserver. If you really need it, I can share this handy little app with you.
    file:///Volumes/Werkshare/fla_test.fla

  • How do You Link to Archived Sites, or files, on the Server via the Wiki?

    I've saved an archived site to workgroup/sites/www.archivedaite.org/. What I want to be able to do is to put a link on my wiki to pick up the index page within this archived site.
    I've tried to use "file:///volumes/groups/workgroup/sites/www.archivedsite.org/index.php.html". While this works fine in the browser location bar, the wiki won't accept it. By this I mean that even if I go in and edit the HTML the wiki deletes the link when you save the page.
    Could I save the file to the "Sites" folder on the server for one of the userers (like the serveradmin one), as a work around?

    Sadly I am having the same issue, and there is nothing in the control center that helps. In previous versions of iOS, I could easily listen to podcasts or my iTunes library though my Bluetooth headset. Double pressing the home button would bring up controls at the bottom of the iPhone screen and to the far right would be an icon where I could select the audio device I wanted. If there was a Bluetooth device synched to the phone, I could choose to listen to the music either via my phone's speakers or via the Bluetooth. This option does not exist anywhere anymore. I just hooked up my Bluetooth (finally got around to it since upgrading) and when playing music either from my phone's internal memory or via iTunes radio, it just comes out over the iPhone's speakers. There is no way to select any other option. Hopefully they'll fix this in 7.0.5.

  • How to access a specific tab in collaboration server - via scripting

    So, I want to be able to show a link in a portlet to a user such that when the link is clicked it takes the user to collaboration server and automatically sets them on the discussion tab...any ideas? do transformer tags work in this case? any other ways?
    Thanks

    QuickKeys may work, or you can look on http://www.versiontracker.com or http://www.macupdate.com for other alternatives.
    Another option is to create aliases to those folders and store the aliases in a local folder which you can place on your Dock, the Finder window sidebar or toolbar.

Maybe you are looking for

  • Oracle 9.2.0.8 Binary Data Problem

    Hi Folks, need some advice from the experts here about an error I got yesterday while installing a (Java-based) Software at a customer using Oracle 9.2.0.8. While being able to work with the database most of the time, I get an error when trying to sa

  • What's the meaning of this!!! (your user icon)

    Okay, it is killing me. I simply must know why everyone picked their icons. Some of you have had discussions about them in random posts, but that is very hard to find. Ben, Why the teddy bear with the sparkle? Tst, are you thinking what I'm thinking?

  • Paint JProgressBar in new Thread

    Hi, I have a DnD Applet for managing your computer(files and folders) at work from home and have a problem with painting a JProgressBar during the drop action. I've tried to paint the JProgressBar in a new Thread but it freezes. I can see the progres

  • Export is too slow using @sid

    Experts please tell why it is taking too much time using @sid? I have read this in orafaq http://www.orafaq.com/forum/t/71979/2/ Is this database on the same server as you are doing the export? Exporting using a TNS entry is very slow, even if it is

  • Selection screen generation

    hi, in my main dialog program, i created a selection screen using statements selection-screen.... i activated it and was able to see that at runtime.. i noticed that the same selection screen was listed in the tree in SE80 under my package under scre