Filename with space problem

Does anyone know why this code is giving me to save the file with the wrong filename? It converts spaces to + signs.
Currently it gives the filename: "test+filename.abc"
The variable resourceName is: "test filename.abc" (<-- this is required filename)
IWDResource resource = WDResourceFactory.createResource(baos.toByteArray(),"test filename.abc",WDWebResourceType.UNKNOWN);
String url = resource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());
String resourceName = resource.getResourceName();
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"download").show();
Edited by: Tom Franssen on Mar 25, 2010 6:04 PM

Hi Tom,
I know exactly what you are looking for.
I have implemented it in my web dynpro application.
Here is the code which you can write in action handler of the download button:-
This will open up a pop-up window asking user to Open/Save As/Cancel type of dialogue.
And you need to perform String manipulation on "p_FileName" to remove all the leading, trailing and intermediate spaces in filename.
     try {
          //Get Url connection and inputStream
          l_url = new URL("<URL STRING>");
          l_urlConnection = l_url.openConnection();
          l_inputStream = l_url.openStream();
          //fill up byte array
          int l_int_arraySize = l_urlConnection.getContentLength();
          l_byteArray = new byte[l_int_arraySize];
          l_dis = new DataInputStream(l_inputStream);
          l_dis.readFully(l_byteArray);
          //reset buffers
          l_inputStream.close();
          l_dis.close();
          //Set the Resource for file
          l_resource = WDResourceFactory.createResource(l_byteArray, p_FileName, WDWebResourceType.UNKNOWN);
          l_byteArray = null;
          //Get the url of created resource
          l_str_url = l_resource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal());
          //Call external window passing the above url
          l_win_MultiFileWindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow(l_str_url);
          l_win_MultiFileWindow.show();
     catch (Exception e) {
Hope it helps.
Let me know in case you need more information.
With regards,
Amey Mogare

Similar Messages

  • Create outline on text with space problem

    I have been askd to make some buisnescard for a friend
    and he have chosen the font Cloister black http://www.dafont.com/cloister-black.font
    So i have set up the cards in ID (cs5) an trying to export them to pdf but gets the allert that the font cant be embede in the PDF so afte googling the problem i found out the outline part and hvae tryd to use that but keeps getting the alert when exporting to PDF.
    I then have tried to truble shot a litte and found out that it happens when i have a space in the text. I Have to write  (on a path) "Pub & Bar" on the cards with that font and if i remove thae spaceses the alert goes away.
    Is ther anny way to get around this problem ?? ( I know i can replaces the spaces with spaces frome another fonttype but is ther anny smarter way to get around this annoying problem )
    I can understand that ID cant outline a space but i almost see this problem as a bug ?

    This is the second time in a week that a problem embedding a Dieter Steffmann font has come up.
    For what it's worth, Herr Steffman does not license his fonts for commercial use, though many of them are digitized versions of old metal faces that don't have a large enough market for the foundries that made them (if even still in business) to release their own digital versions. That's not the case, however, with Cloister Black. There is a digital version from Bitstream with proper license provisions here: http://www.myfonts.com/fonts/bitstream/cloister-black/

  • Problem in opening filename with space

    Hi Folks,
    I am trying to open a file located on websphere appserver. file name has a space in between. (e.g. abc xyz.xls)
    I could not open the file in netscape and IE both.
    Has any one come across such problem?

    If the filename is part of an URL, you have to replace the
    spaces by plus signs: http://.../.../abc+xyz.xls.

  • Apex Listener/Apache Tomact and filenames with spaces

    I've installed the Apex Listener with Apache Tomcat, and all seems to work fine. Except when I try to do a CSV file data upload via the utilities screen in apex. If the filename/directory path contains spaces, then Apex reports "File Must Be Specified" error - yet if I do this same operation via EPG instead of Tomcat, it works. Are there any restrictions in Tomcat to using spaces??

    Look at this thread. Re: File upload problem
    regards.

  • When saving filename with space, the space char convert to %20. How can i solve this?

    Each time when i try to save a file. Firefox always convert the space char to %20. This is really irritating.
    Any solution?

    Thanks for trying to help. Maybe i did not specific my issue clear enough, each time when i try to download a file from my university elearning site. The filenames suggested by firefox automatically change space char to %20. I need to manually remove those %20 to space char again when i save the file, this is really not convenient. I tried on Chrome and IE, both of them do not have this problem with the same file.

  • Problem with spaces in filenames

    Created a photo album in iPhoto and exported to iWeb. When I try to upload to my Comcast homepage, several graphics elements in the photo album page have spaces in their filenames and Comcast balks. Is there a way to keep iPhoto/iWeb from utilizing filenames with spaces in them? Thanks.
    MacBook Pro   Mac OS X (10.4.8)  

    Hi Stanley...
    I'm glad that you got your space problem fixed. If you ever update your site, though, you'll have to redo all of your hard work eliminating the spaces. Here's a little utility that will do this for you a little bit more automatically...
    http://www.brokenropesoftware.com/iWebFTPUtility/iWebFTPUtility.html

  • Problems with spaces in file or directory names and Word.exe

    Hi
    I'm trying to open a file with Word from my java aplication, and I have a problem with some file/directory names.
    I have this
    String cmd = "c:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" + " " + path;
    try {
    Runtime.getRuntime().exec(cmd);
    } catch (Exception errorea){ }
    Here is what happens:
    if path is something like this: "c:\people\info.doc" , there's no problem, Word opens the document, but if path contains blank spaces somewhere, it doesn't work. For example:
    path = "c:\Documents and Settings\info.doc"
    path = "c:\Hi everybody\info.doc"
    path = "c:\tests\test results.doc"
    with the above examples it doesn't work :( Word tries to open "c:\Documents", "c:\Hi" or "c:\tests\test".
    Can anyone help? thanx a lot ! : )

    Hint: use the variant Runtime.exec(String[] args).
    Create a command array, with each token in a separate argument. The entire filename with spaces goes into one argument.

  • Filename with tab returned by getFileName()

    Our product uses JavaMail (1.4) to import mail messages from IMAP servers into our product.
    One of our clients is currently having a problem that sometimes attachments are not imported because they cannot be saved due to incorrect characters in the filename. Part of the reason is that we did not sanitize the output from Part.getFileName() (a MimeBodyPart in this case)
    We found out that in this case getFileName() returns a filename containing a tab (ascii 0x09), because (probably) their mailclient (Groupwise 7.0.2 HP) does not follow the intention of RFC 822 / 2822 (although it does conform to the letter of RFC 822) for the handling of long header fields. The mailclient has - as far as I can see - replaced a space in the filename by CR/LF and a tab (where I would expect CR/LF and a space).
    When JavaMail decodes the header this is (of course) decoded by replacing the CR/LF + tab by a tab, and getFileName simply returns the value of the filename parameter of the Content-Disposition header (including the tab).
    I would like to know:
    - Is there a system property to 'fix' this behaviour
    - Could you change the behaviour of getFileName() so it replaces any tabs in the filename with spaces (as far as I know there is no OS that allows tabs in filenames)

    Hi..thanks a bunch! The quotes did help. But there was another glitch. I could not store the existing file name in $oldfilename variable as only that part of the filename before the tab got stored. So wrote the filenames in the folder into a list file and then renamed one by one. Below is the code:
    for file in `ls $FilePath | sed 's/[     ]/,/g'`
    do
    echo $file >> $FilePath/"TabFiles"
    done
    ListFile=$FilePath/TabFiles
    for line in `cat ${ListFile}`
    do
    OldFile="$(echo "$line" | sed 's/[,]/     /g')"
    NewFile="$(echo "$line" | sed 's/[,]//g')"
    if [ "$OldFile" != "$NewFile" ]
    then
    mv "$OldFile" "$NewFile"
    fi
    done
    rm -f $FilePath/"TabFiles"
    I know the idea looks rather clumsy. Is there a better way of handling this?

  • How do I enter a path with spaces

    In creating a special mail alert there is an option to enter a file to execute. If I put the file in my C;/Program Files (86)... it wont execute because of the spaces. How do I enter the path and filename with spaces. YES, I have tried all sorts of "s and they don't seem to work. Can you give an example.

    I usually find that if use the offered option to browse to the file using the browser/picker provided, all this is taken care of. Thunderbird will use a technique widely emplyed on the web, where spaces are encoded as %20. Other potentially troublesome characters such as slashes and colons will get similar treatment.
    As an aside, 20 is hexadecimal for the decimal value 32, which is the standard value in ASCII and many other encodings for the space character. So %20 is a particular notation that advises that the character with hexadecimal value 20 is to be used.
    In general "C:\Program Files\example\example.txt" ought to work too.
    But your problem may be specific to the particular context. I have had a long standing issue where I want to send a link to a file on a shared network drive and the link sent via Thunderbird has refused to work as an active link. The recipient generally had to copy and paste the provided pathname. This seems to have resolved itself in a recent update of Thunderbird. If you're using an add-on then the problem may be inherent in that add-on, or in a rather obscure difficulty with giving the Thunderbird process access permission to work with local files.

  • B2B attachment filename having space in UNIX server.

    Hello B2B Gurus,
    I am working on B2B for Rosettanet.
    It also sends the attachment picked from UNIX server along with PIDX format payload.
    If the file name in the UNIX server has a space, Rosettanet along with attachment errors out with
    B2B-51570-
    Machine Info: (hou-ecmsoatst01.swn.com)
    Description: Attachment error
    If the file name does not have any space, the attachment logic works file.
    I used the below link for reference, which was really helpful to attain attachment logic.
    http://anuj-dwivedi.blogspot.com/2011/04/rosettanet-attachment-handling-in.html.
    Can anyone help me to handle filename with space in UNIX server to be sent as attachment.
    Thanks,
    Sunil

    Can you try to escape space with %20 ? For e.g. if file path is file:///b2b file/OrderBill.pdf then provide it as file:///b2b%20file/OrderBill.pdf
    Regards,
    Anuj

  • Replacing comma with space

    Hi,
    Note : I am using SAP 4.6
    Task      : Replace Comma with space
    Problem : Not able to replace comma with space
    I have task where I have to write result file to application server, when I am writing string to application server it is separating by comma, for example if you take below statement it is dividing by space that means in first column PO and then ITEM etcu2026.
    MOVE  'PO ITEM is not there in table EKPO' TO W_RECORD_OUT-ERROR_MSG.
    so to resolve this situation I have used below code for now, I know I can use
    REPLACE ... ALL ENTRIES but this statement is not working in SAP 4.6
    REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
    appreciate if somebody can help me.
    Thanks
    sarath

    Hi,
    Please check the below code.
    REPORT  YSAT_TEST.
    Data: Var1(40) type c value 'Test1,Test2,Test3,Test4'.
    break-point.
    REPLACE ',' WITH space INTO Var1.                   " It will replace only first occurrence
    replace all occurrences of ',' in var1 with '   '.
    CONDENSE Var1 no-gaps.
    write: var1.

  • Mail.app: I can't send attachment with "space" in filename

    Hi.
    I've this kind of problem. I think it is Mail.app problem. The mail isn't sent if the attachment's filename contains "space" (eg: "file name.pdf").
    The same email is sent finw if I use Thunderbird with the same SMTP server (Leopard Server) and from the same machine.
    If the recipinets in local (not relayed over internet) it works well. Otherwise the SMTP server tell me it have lost connection whith relay server (ISP SMTP server).
    I've used Lotus domino Server as SMTP server with the same result.
    If I cut the "space" (' ') in the attachment's filename Mail.app works fine as well.
    HELP!
    thanks.
    P.S.: sorry for my english
    Message was edited by: odolo
    Message was edited by: odolo

    There is a bug which causes the filenames of attachments with a space or an accented character in the name to have characters appended to the filename extension; it may be that it also sometimes stops the attachment from sending. But other people have reported problems with mails with attachments not sending regardless of the filename, so I think the next software update will see some fixes.
    Meanwhile, don't use spaces!
    AK

  • [SOLVED] problem with spaces and ls command in bash script

    I am going mad with a bash script I am trying to finish. The ls command is driving me mad with spaces in path names. This is the portion of my script that is giving me trouble:
    HOMEDIR="/home/panos/Web Site"
    for file in $(find "$HOMEDIR" -type f)
    do
    if [ "$(dateDiff -d $(ls -lh "$file" | awk '{ print $6 }') "$(date +%F)")" -gt 30 ];
    then echo -e "File $file is $(dateDiff -d $(ls -lh "$file" | awk '{ print $6 }') "$(date +%F)") old\r" >> /home/panos/scripts/temp;
    fi
    done
    The dateDiff() function is defined earlier and the script works fine when I change the HOMEDIR variable to a path where there are no spaces in directory and file names. I have isolated the problem to the ls command, so a simpler code sample that also doesn't work correctly with path names with spaces is this:
    #!/bin/bash
    HOMEDIR="/home/panos/test dir"
    for file in $(find "$HOMEDIR" -type f)
    do
    ls -lh "$file"
    done
    TIA
    Last edited by panosk (2009-11-08 21:55:31)

    oops, brain fart. *flushes with embarrassment*
    -- Edit --
    BTW, for this kind of thing, I usually do something like:
    find "$HOMEDIR" -type f | while read file ; do something with "$file" ; done
    Or put those in an array:
    IFS=$'\n' ; files=($(find "$HOMEDIR" -type f)) ; unset IFS
    for file in "${files[@]}" ; do something with "$file" ; done
    The later method is useful when elements of "${files[@]}" will be used multiple times across the script.
    Last edited by lolilolicon (2009-11-09 08:13:07)

  • Firstly, I can't open iPhoto on my macbook as of a few days and could it have anything to do with a problem I have updating my iPhone's software as I've downloaded extra iCloud storage but I still can't get the iPhone to recognise the space for software

    Firstly, I can't open iPhoto on my macbook as of a few days and could it have anything to do with a problem I have updating my iPhone's software as I've downloaded extra iCloud storage but I still can't get the iPhone to recognise the space for software

    No. With the amount of information you've provided it's impossible to offer a potential solution.  We can't see your computer so we need to know the details of your problem and setup, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    what do you see when iPhoto opens?
    what fixes have you tried?
    where is your library located?
    did you apply any updates or upgrades just prior to the problem occurring?
    are you running a "managed" or "referenced" library?
    what type of Mac?
    how much free space on your boot drive?
    For the iPhone issue ask in the iPhone forum.
    OT

  • Problems with Filenames with Chinese Characters

    I seem to have problems with filenames with 2-byte characters like Chinese, Japanese and Korean in various apps. The problems occur when i download chinese music and import into iTunes :
    1. Torrent ( and all other ) files with 2-byte characters filename become junk characters in Finder after download from Safari.
    2. Music files created/downloaded by uTorrent displays 2-byte characters correctly in Finder.
    3. These downloaded music files when imported into iTunes becomes junk characters.
    4. Let say I wish to have a list of all filenames from (2). I do a ls -R > abc.txt in Terminal. abc.txt displays the filenames correctly in vi. However they become junk characters again when view using TextEdit.
    I've selected Chinese, Japanese, Korean in International setting. This is not about input method, just want to get the filenames correct in Finder and iTunes. Any advice is appreciated.

    3. These downloaded music files when imported into iTunes becomes junk characters.
    The ID 3 tags need to be in Unicode.
    http://homepage.mac.com/thgewecke/mlingos9.html#itunes
    4. they become junk characters again when view using TextEdit.
    TextEdit needs to be set to the correct encoding, it's not automatic.

Maybe you are looking for

  • How to give  Value set for model attribute?

    Hi all,        How to give value set for model attribute?        plz explain me with some sample code. Regards, Srinu

  • JComboBox selection and highlight problem of the selected item

    Hi, I have a question how can I make my newly added item to the combo-box selectable and highlighted. I am adding new items to my custom comboBox dynamically and I want whatever item I add to be selected by default. I am using my own custom ComboBoxM

  • Subquery for inserting doesn't work in Oracle package

    I have experienced a very strange scenario while inserting data inside a Oracle package. I have two tables: - table "A" Columns: "ID", "Value1", "...." - table "A_Backup", which contains backup data for table A. It has one more column "BATCH_NUMBER"

  • Safari 6.0 go directly to website

    Prior to Safari 6.0, I was able to type in a name of a business and it would go straight to that business and not to a Google search. For example, in the prior version, if I typed in "Tingo", it would go directly to Tingo.com. But with 6.0, it goes t

  • Jakarta-tomcat-4.1.31 unable to compile class in jsp

    anyone??solve tis ploblem type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occu