Problem with checking file existence by using app.openDoc

Hi Folks,
I have to create a script for a big project with many PDF's. (Just like Ingrimm - it's the same company http://forums.adobe.com/thread/747022?tstart=0) This PDF's are made of scanned images. I need to rename the files to names that are extracted from within the file. This is working without problems.
Now there could be the case, that a filename exists already. I don't want the files to be overwritten, so the idea is, that already existing filenames are saved as filename_1, filename_2, etc... (Before I merged them, but this isn't what is wanted.)
For this reason I need to use app.openDoc to check, if a file exists. Yesterday my script worked fine, but after starting it today, I discovered that it started again to overwrite files which are already existing.
I added an app.alert to my catch method to see what error is thrown. The message is: 'NotAllowedError: Security settings prevent access to this property or method.'.
After using google, I found out, that Acrobat is not finding any files. But I checked and there are files which should be doubled.
I have no idea how to fix that problem. Anybody here who can help me?
Regards,
Steffi
* regular expression for search
var idNumber = /08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d/g;
* if possible this function extracts the searched number as string
* @param rematch string which should be searched in document
* @return null if rematch is not found or string if rematch is found
function ExtractFromDocument(reMatch) {
  try {
         var Out = new Object();
         for (var i = 0; i < 1; i++)
          numWords = this.getPageNumWords(i);
          var PageText = "";
          for (var j = 0; j < 30;j++) {
              var word = this.getPageNthWord(i,j,false);
              PageText += word;
          var strMatches = PageText.match(reMatch);
          if (strMatches == null) continue;
      return strMatches;
  } catch(e)
      app.alert("Processing error: "+e)
* tries to load given filename (extracted number)
* @param filename string of file which should be checked
* @param n number to iterate while checking for files
* @return true if file exists or false if not
function checkIfFileExists(filename, n) {
    var existingDoc = false;
    try {
        if( n == 0) {
            var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001.pdf"});
        } else { 
            var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001_"+n+".pdf"});
        checkDoc.closeDoc();
        existingDoc = true;
    } catch (e) {  
         app.alert("Processing error: "+e)
    if( existingDoc == true ) {
        n = n+1;
        n = checkIfFileExists(filename, n);
    return n;
var filename = ExtractFromDocument(idNumber);
if(filename == null || filename == undefined) {
  filename = Math.round(Math.random()*999999999999);
  this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/n_"+filename+".pdf"});
} else {
    fileExistence = checkIfFileExists(filename, 0);
    if(fileExistence != 0) {
        this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001_"+fileExistence+".pdf"}); 
    } else {
        this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001.pdf"});

Sorry, I marked it as bold text but unfortunately it happens to be unformatted
It's the app.openDoc within my function checlIfFileExists:
try {
        if( n == 0) {
           var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001.pdf"});
        } else  { 
           var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001_"+n+".pdf"});
         checkDoc.closeDoc();
        existingDoc = true;
     } catch (e) {  
         app.alert("Processing  error: "+e)

Similar Messages

  • Problems with uploading file to database using FND_GFM

    Hi
    I'm having some problems uploading files to the database in apps 11.5.9
    As various sources/documents tell me, using the standard FND_GFM / FND_FILE_UPLOAD packages of APPS should transfer an uploaded file into the FND_LOBS table, but some reason it doesn't work. I copied and altered the FND_GFM.upload_confirm function to try and figure out why it doesn;t work and it looks like the file to be uploaded does not appear in the defined table (FND_LOBS_DOCUMENT).
    The following DAD is defined (with hidden password and servername to prevent abuse ;)):
    [DAD_oes_s]
    connect_string = oes_s
    password = ****
    username = APPS
    default_page = fnd_web.ping
    document_table = APPS.fnd_lobs_document
    document_path = docs
    document_proc =
    upload_as_long_raw =
    upload_as_blob = *
    reuse = Yes
    connmax = 10
    pathalias = fndgfm
    pathaliasproc = fnd_gfm.dispatch
    enablesso = No
    cgi_env_list=SERVER_NAME=***,REQUEST_PROTOCOL=http,SERVER_P
    ORT=***,HOST=***
    input_filtering = Yes
    stateful=STATELESS_RESET
    And I'm using the following code to generate the upload-file page
    CREATE OR REPLACE PROCEDURE XX_ITRIS_HelloWorld AS--(file IN VARCHAR2) AS
         access_id_v varchar2(1000);
         BEGIN
              htp.htmlOpen;
              htp.bodyOpen;
              htp.formOpen('http://***/pls/oes_s/fnd_file_upload.uploadcompletemessage', 'GET', null, 'multipart/form-data');
              htp.formFile('file');
              access_id_v := fnd_gfm.authorize(null);
              htp.formHidden('access_id', access_id_v);
              htp.formSubmit();
              htp.formClose;
              htp.line;
              htp.bodyClose;
              htp.htmlClose;
         END XX_ITRIS_HelloWorld;
    Can anybody point out what is going wrong?

    You said you are uploading XML file whereas in the TSQL you have assign as text file i.e @SourceFile = 'test.txt'. Are you sure that you are copying XML file ? What is the size of the source file "test.txt" ? I am sure it is 0 KB. That is what you
    have found in FTP site.
    Regards, RSingh

  • Problems with opening files in correct app

    Hi guys
    Recently we have switched over at my company to OSX tiger. I work for a design firm doing artwork for various clients in the retail sector. We have a bank of logos and images on file that we use, mostly Illustrator eps saved in version 10 of the application. We are having problems opening these files in the right app. It keeps defaulting to opening in Photoshop. When we change the settings in get info and apply them to all, all our photoshop eps try and open in Illustrator. This is proving a real pain especially when opening the files from Quark after double clicking on the image and pressing the edit original button. Is there any way we can tell the system to open Illustrator files in Illustrator and Photoshop files in Photoshop.
    Cheers Thom

    Hi, Thom.
    You wrote: "We have a bank of logos and images on file that we use, mostly Illustrator eps saved in version 10 of the application. We are having problems opening these files in the right app. It keeps defaulting to opening in Photoshop. When we change the settings in get info and apply them to all, all our photoshop eps try and open in Illustrator."You are describing the procedure in "Mac OS X 10.4 Help: Changing the application that opens a document."
    The problem is due to the fact that a given file type or extension, e.g. .eps, can be bound via "Change All" to only one application. If you bind (set the default application) all .eps to Illustrator, that's what they'll all open in.
    For the situation you have, you need to bind the documents individually to the specific application. If you can gather a selection of the documents, you can use the contextual menu of the selection (Control-click or right-click the selection), hold the Option key, select "Always open with..." and select the desired application. The selected documents will open in that application and they will henceforth be bound to it until you again change the documents default application.
    You can reset all the default bindings you've defined by using the Tiger-specific procedure in my "Resetting Launch Services" FAQ. Start with Step 6 since you also want to eliminate user-defined bindings.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • TS4040 I assumed this would help my problem with not being able to open apps like Preview or TextEdit since I installed Mountain Lion. Instead, first I'm prompted to enter a password, then once I do that, I get an error box telling me the Library needs re

    I assumed this would help my problem with not being able to open apps like Preview or TextEdit since I installed Mountain Lion. Instead, first I'm prompted to enter a password, then once I do that, I get an error box telling me the Library needs repairing. So I click on Repair, and once again I'm prompted for a password, which I enter, then the same error box opens, and so it goes. Can anyone help me with this problem? I'd greatly appreciate it.
    Thor

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Step 1 should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary, and if everything is working as expected after step 1.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • [SkyDrive] Files can't be uploaded because there's a problem with a file or folder.

    On Windows 8.1 RTM, the SkyDrive metro client shows a message that "Files can't be uploaded because there's a problem with a file or folder." and lists one particular file. When I installed the PC, I have switched then Access all files offline
    option to On.
    The file resides in a directory I have deleted from the disk. When attempting to get rid of this "problem" (as there are no hints nor UI available) I have manually checked that the directory does not exists on the disk any more, as well as deleting
    the directory from cloud storage using a web browser. However, the message is still there.
    Restarting the computer several times nor keeping it idle for a significant amount of time did not help.
    How to get rid of that "problem" / how to fix it?

    Hi
    Let’s try to redirect the skydrive folder and sync again to see what’s going on:
    1. Open regedit and find following key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\SkyDrive
    2. Change “UserFolder” to another location.
    3. Open the SkyDrive Metro app to confirm your files and new directory.
    Then check the issue again. 
    Regards,
    Kate Li
    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.

  • Problems with .ARW files and auto toning

    problems with .ARW files and auto toning
    let me try to explain this because this has happened in past and never found a way to resolve but i lived with it
    now that I have a Sony A7R the problem is more serious
    Firstly i take pride it making the picture happen all in camera, i use DRO lvl 5 to get enough light, like when i'm shooting at dusk. DRO its like doing HDR but in a single file, it lightens the darks. in my camera i'm happy with results
    but when I upload them to lightroom, they come out near black.
    allow me to explain
    lets say I import 100 images
    i double check my preferences and everything is UNCHECKED when it comes to importing options, there is no auto toning, nothing.
    as the images import i see a preview in the thumbnail which looks fine.
    i double click on one to enlarge it, hence leave grid view.
    for a brief 1 or 2 seconds, i see the full image in all its glory but than lightroom does something funny, it darkens the image
    one by one as it inspects each image, if it was a DRO image it makes it too dark.
    to make this clear, the image is perfect as it was in the beginning but after a few seconds lightroom for some reason thinks it needs to correct it.
    how to prevent lightroom from doing this, i want the image exactly as it is, why must lightroom apply a correction>?
    i think it has to do something with interpreting the raw file and lightroom applies its own algorithm.
    but here is what i dont get.....before lightroom makes the change i'm able to witness the picture exactly as it was taken and want it unchanged..
    now i have to tweak each file or find a profile for it which is added work.
    any ideas how to prevent lightroom from ruining my images and just leave them as they were when first detected...
    there are 2 phases...one is when it originally imports and they look fine
    second is scanning each image and applying some kind of toning which darkens it too much.
    thanks for the help

    sorry thats the auto reply message from yahoo email.
    i've disabled it now
    thing is, there is no DRO jpg to download from the camera
    its only ARW. so my understanding is when i use DRO setting, the camera makes changes to the ARW than lightroom somehow reads this from the ARW.
    but then sadly reverts it to no DRO settings.
    because i notice if i take normal picture in raw mode its dark but if i apply dro to it, it comes out brighter, yet when i d/l the image from camera to lightroom, which is an ARW - there are no jpgs. lightroom decides to mess it up
    so in reality there is no point in using DRO because when i upload it lightroom removes it.
    is there a way to tell lightroom to preserve the jpg preview as it first sees it.
    its just lame, picture appears perfect...than lightroom does something, than bam, its ruined,.
    what do i need to do to prevent lightroom from ruining the image? if it was good in the first place.

  • SFTP MGET of large files fails - connection closed - problem with spool file

    I have a new SFTP job to get files from an FTP Server.  The files are large (80mg, 150mg).  I can get smaller files from the ftp site with no issue, but when attempting the larger files the job completes abnormally after 2 min 1 sec. each time.  I can see the file is created on our local file system with 0 bytes, then when the FTP job fails, the 0 byte file is deleted.
    Is there a limit to how large an ftp file can be in Tidal?  How long an ftp job can run?
    The error in the job audit is Problem with spool file for job XXXX_SFTPGet and an exit code of 127 (whatever that is).
    In the log, the error is that the connection was closed.  I have checked with the ftp host and their logs show that we are disconnecting unexpectedly also.
    Below is an excerpt from the log
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.055 : Send : Name=SSH_FXP_STAT,Type=17,RequestID=12
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.055 : Transmit 44 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.055 : Remote window size decreased to 130808
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.071 : RepeatCallback received 84 bytes
    DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.071 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
    DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.071 : Received message (type=105,len=37)
    DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.071 : AddMessage(12) - added to store
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Reply : Name=SSH_FXP_ATTRS,Type=105,RequestID=12
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Send : Name=SSH_FXP_OPEN,Type=3,RequestID=13
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.071 : Transmit 56 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.071 : Remote window size decreased to 130752
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.087 : RepeatCallback received 52 bytes
    DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.087 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
    DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.087 : Received message (type=102,len=10)
    DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.087 : AddMessage(13) - added to store
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Reply : Name=SSH_FXP_HANDLE,Type=102,RequestID=13
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Send : Name=SSH_FXP_READ,Type=5,RequestID=14
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.087 : Transmit 26 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.087 : Remote window size decreased to 130726
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.118 : RepeatCallback received 0 bytes
    DEBUG [SFTPChannelReceiver] 6 Feb 2015 14:17:33.118 : Connection closed:  (code=0)
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : Disconnected unexpectedly ( [errorcode=0])
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : EnterpriseDT.Net.Ftp.Ssh.SFTPException:  [errorcode=0]
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 :    at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.CheckState()
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 :    at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.GetMessage(Int32 requestId)

    I believe there is a limitation on FTP and what you are seeing is a timeout built into the 3rd party application that tidal uses (I feel like it was hardcoded and it would be a big deal to change but this was before Cisco purchased tidal)  there may have been a tagent.ini setting that tweaks that but I can't find any details.
    We wound up purchasing our own FTP software (ipswitch MOVEit Central & DMZ) because we also had the need to host as well as Get/Put to other FTP sites. It now does all our FTP and internal file delivery activity (we use it's api and call from tidal if we need to trigger inside a workflow)

  • Problems with compressing  files with right hand click. it does not work.

    Problems with compressing files with right hand click.
    I am using the compress function in the Mac OS (File > Compress XX) from time to time. Today it does not work anymore. OS 10.5.6
    I get a message: The content list cannot be created for compressing.
    I tried it with files and folders and keep getting this message. Anybody any idea as to how to fix this

    Thanks I love my macbook!!!!
    I also got further problems such as copy-paste not working etc.
    so I fixed it just this morning by running Applejack 1.5 and am back up running noticing your post.
    thanks for helping though!

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • What is the exact problem with this file?

    Hi all,
    There is an old form , which was not in use from many days.
    Now when we tried to run the form, i got the error saying "FRM-40734:Internal Error:Pl/SQL error occured.", in the login form.
    When i tried to open the fmb file in Oracle Forms Builder 6i, i got the following error:
    FRM-10102: Cannot attach PL/SQL library d2kwutil. This library attachment will be lost if the module is saved., but the fmb file got open.
    The login button has the following code:
    DECLARE
      UNAME VARCHAR2(30);
      --USER_ID PARAMLIST;
      V_USER APUSERMA.USER_NAME%TYPE;
      V_PASSWED APUSERMA.USER_PASSWD%TYPE;
    BEGIN
    select user_CD INTO :GLOBAL.USER_ID from apuserma 
    where user_CD = :TI_USER_NAME AND user_PASSWD = :IT_USER_PASSWD
    AND SYSDATE BETWEEN USER_VALID_FRM AND USER_VALID_TO;
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    :global.compname := :compname;
    compnm(:compname);
    --USER_ID := CREATE_PARAMETER_LIST('USER_id_NAME');
    call_form('Forms\MAIN_SCREEN',hide,DO_REPLACE);
    exception
      when no_data_found then
      MESSAGE('Incorrect Username or Password.  Please Re-Enter');
      message(' ');
      RAISE FORM_TRIGGER_FAILURE;
    END;
    EXIT_FORM;
    When i tried to compile, i got error saying ,
    Error 201 at line 10, column 28
    identifier 'WIN_API_ENVIRONMENT.READ_REGISTRY' must be declared.
    I am not getting to know What is the exact problem with this file?
    Help me with this please.
    Thank You.
    Oracle forms builder 6i.
    Oracle 9i.

    Vijetha wrote:
    I also want to know what is the use of  win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername') ??
    What does it do??
    If i comment the following line , will it be a problem??
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    Because i commented the above line & compiled, so it is not giving any error now.
    So please tell me what win_api_environment.read_registry does??
    it's read windows registry value. So, no problem if you comment it.
    Thanks

  • Has anyone had a problem with TapMedia File Manage on iPhone 5. I reported a WIFI functionality problem to the developer and asked for support. Instead they have been very unprofessional by name calling me instead of logically evaluate and troubleshoot th

    Has anyone had a problem with TapMedia File Manage installed on iPhone 5? I reported a WIFI functionality problem to the developer and asked for support. Instead the company has been very unprofessional by name calling me instead of logically evaluate and troubleshoot the problem

    Hi AKE1919,
    Welcome to the Support Communities!
    The following information should help you with this:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    Judy

  • Problem with URL File download

    Hi every one i am facing a problem with URL File read Technique
    import java.awt.Color;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    public class JarDownloader
         boolean isSuccess = false;
         public JarDownloader(String url)
              downloadJar(url);          
         public boolean isDownloadingSuccess()
              return isSuccess;
         private File deleteExistingFile(String filename)
              File jarf = new File(filename);
              if(jarf.exists())
                   jarf.delete();
              return jarf;
         public static void main(String args[]){
              new JarDownloader("url/filename.extension");
         private void downloadJar(String url)
              try
                   URL jarurl = new URL(url);
                   URLConnection urlc = jarurl.openConnection();
                   urlc.setUseCaches(false);
                   urlc.setDefaultUseCaches(false);
                   InputStream inst = urlc.getInputStream();
                   int totlength = urlc.getContentLength();
                   System.out.println("Total length "+totlength);
                   // If the size is less than 10 kb that means the linkis wrong
                   if(totlength<=10*1024)throw new Exception("Wrong Link");
                   JFrame jw =new JFrame("Livehelp-Download");
                   JPanel jp =new JPanel();
                   jp.setLayout(null);
                   JLabel jl = new JLabel("Downloading required file(s)...",JLabel.CENTER);
                   jl.setBounds(10,10,200,50);
                   jp.add(jl);
                   JProgressBar jpbar = new JProgressBar(0,totlength);
                   jpbar.setBorderPainted(true);
                   jpbar.setStringPainted(true);
                   jpbar.setBounds(10,70,200,30);
                   jpbar.setBackground(Color.BLUE);
                   jp.add(jpbar);
                   jw.setContentPane(jp);
                   jw.pack();
                   jw.setResizable(false);
                   jw.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                   jw.setLocationRelativeTo(null);
                   jw.setSize(220,150);
                   jw.setVisible(true);
                   int readlngth=0;
                   int position=0;
                   byte[] readbytes = new byte[totlength];
                   while(totlength-position > 0)
                        readlngth = inst.read(readbytes,position,totlength-position);
                        position+=readlngth;
                        jpbar.setValue(position);
                   File jarf = deleteExistingFile(filename);
                   jarf.createNewFile();
                   //FileWriter fwriter=new FileWriter(jarf,true);
                   FileOutputStream fout = new FileOutputStream(jarf,true);
                   DataOutputStream dout = new DataOutputStream(fout);
                   dout.write(readbytes);
                   dout.flush();
                   dout.close();
                   inst.close();
                   jw.setVisible(false);
                   jw.dispose();
                   isSuccess=true;
              }catch(Exception ex)
                   isSuccess=false;
    }From the above code i received the total length of the PAGE content (i.e here url is a file) when i tried to find the size of that file it return -1.
    please help me

    I think the real problem is that you don't check the return value from read (it's probably less than data.length indicating an incomplete read). Isn't there a readFully somewhere?

  • Problems with the File System Repository & User Mapping!

    Hi All
    I am having a problem with a file system repository, and setting up user mapping for that repository.
    I have done the following:
    Created a File System Repository
    Created a Network Path
    Created a System (Including the alias)
    Now when I go into User Administration and select my user the is no user mapped systems to select.
    All this system is doing is connecering to a folder on our File System.
    Any help would be great as this is really frustrating!
    Thanks
    Phil

    I am using EP7 Stack 11 and unfortunately the only options I have are:
    user
    admin
    admin,user
    It is currently set to admin, user and does not seem to work!
    Phil
    Message was edited by:
            Phil Wade

  • Solutions for problems with QuickTime files in After Effects CC (12.0)

    We have a new blog post up about solutions for problems with QuickTime files in After Effects CC (12.0) because of conflict with DVCPROHDVideoOut QuickTime components. 
    Please read that post and let us know here on this forum thread if you have any questions or comments. 
    Also, please let us know if the proposed solution works for you.

    Mark - The new document that we published is meant to address a specific issue. You can confirm you have the issue by the following:
    Adobe QT32 Server is not running when you receive these errors. Keep Activity Monitor open to track whether or not it is running.
    The crash log for QT32 Server indicate CoreAudio as the last component called. You can find the crash logs in Users/username/Library/Logs/DiagnosticReports. The report will look like this:
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   ???                                     0x04981f90 0 + 77078416
    1   com.apple.audio.CoreAudio               0x949d05c1 __Call_block_invoke_03 + 56
    2   libdispatch.dylib                       0x94a90f8f _dispatch_call_block_and_release + 15
    If this is not the issue you're having, please start a new thread and provide the usual data. If your problem does match this issue, please double-check that you've followed the steps in the new document and post back here.

  • Problem with m3u files and Quicktime

    Hello:
    I have made one update with Quicktime software (version 7.6.9 1680.9). The problem is that Quicktime player reproduces mp3 files but when I try to play m3u files the sound is very bad. It sounds like gargling.
    For example: This files play ok:
    http://www.telefonica.net/web2/sevarra/Sarabande.mp3
    It plays ok when the previous link is introduced as URL address in Quicktime player, but the corresponding m3u files sounds like gargling
    http://www.telefonica.net/web2/sevarra/list0.m3u
    I think there a problem with m3u files and Quicktime.
    Tank you very much and best regards.

    I have discovered that when the URL is playing (with gargling sound) if I open the A/V controls in QT menus and I move the Jog Shuttle or the Speed level then the sound becomes good.
    Yes! Great catch, ttfrank. I can replicate that too.
    Interesting ... if (after getting the sound working properly again) you then pause play of the m3u, and start it again, you get the gargling/dalekish sound quality back again.
    Bug reporting ... there's a couple of ways you can go about doing this. You can use the QuickTime product feedback form:
    http://www.apple.com/feedback/quicktime.html
    ... but if you want to track progress on the bug, try instead registering as an Apple Developer (for free):
    http://developer.apple.com/programs/register/
    ... and then you'll be able to submit the bug via the Apple Bug Reporter:
    http://developer.apple.com/bugreporter/
    In the meantime, there's also a restricted forum available to level 4 and 5 members ("Notable New Technical Issues") where we can report this sort of thing. I'll try to get a post written up on the topic there later today.

Maybe you are looking for

  • My A64 3000 @ 2.3Ghz 1:1 - Can you help me go further? :o)

    Hello everyone. Just wondering if anyone can help me. I have hit a brick wall with my overclock but I hope I can push it a little bit further, since other people have started to have more success. So far I have managed 230HT 1:1 thus reaching 2.3Ghz

  • No longer recognises my speaker dock?

    Since updating my ipad 2 it now no longer recognises my speaker dock which it has been working perfectly with for the past 12mths? How do I fix it?

  • How to search for documents that do not contain a word in a section?

    For example: (deleted% within folder) finds all documents that have deleted in the folder I want to find all documents that do not contain "deleted%" within folder.

  • Make user/curson back & forth between the subforms of form?

    Hello I am developing a adobe interactive form (webdynpro ABAP) with 4 sections/blocks to represent each sub form. I have 4 sub forms, say my_sub_form_1..... my_sub_form_2.......... my_sub_form_3........ my_sub_form_4, say, here user is family_head M

  • IE can display certain web pages.

    Hi IE 11 - when I try accessing certain web pages I get the following message: Oops! Internet Explorer could not connect to..... Try reloading:  It only happens when I am using my OPTUS Service - USB Modem (3G).I have treid using other providers Tels