Workflow Soluiton

 View Only
  • 1.  How to read a file with URL encoding in the file name

    Posted Oct 22, 2014 03:57 PM

    I have a workflow that needs to read files from a Subversion repository that is available via a URL.  Many of the files were created with the %20 URL encoding used to replace an ASCII space.  When I try to read these files I get a (404) Not Found error.  I assume that when the name is being resolved the system is replacing the %20 with a space.  The files that do not have the URL encoding process without any problems.

    I am using a Read Files component with the File Path Type set to URL.  Does anyone have a suggestion for getting the system to read the %20 as valid characters in the file name?



  • 2.  RE: How to read a file with URL encoding in the file name

    Posted Oct 22, 2014 04:32 PM

    not that it's very helpful, but I just attempted to replicate your problem and was unable to do so.  I tried:

    1. Read File - URL with a file name including a space (encoded to %20)
    2. Read File - URL without any spaces
    3. Read File - URL with a directory including a space (encoded to %20)
    4. Read File - URL with a directory including a space and a file including a space (encoded to %20)

    do any of these items represent your circumstances?  all 4 components worked without exception.



  • 3.  RE: How to read a file with URL encoding in the file name

    Posted Oct 22, 2014 04:41 PM

    I am unable to read a file named https:// .../Alarms/TDIG_DP-APP-WEB_License%20error.xml

    I am able to read a file named https://  .../Alarms/TDIG_DP-APP-WEB_VM_Heartbeat.xml

     

    The first filename resulted in the (404) Not Found error.  The second filename was successfully read.

     



  • 4.  RE: How to read a file with URL encoding in the file name

    Posted Oct 22, 2014 05:19 PM

    are you able to browse to the files with the %20 in the URL?

    how are you providing the URL value to the "Path And File Name" field? (process variable, dynamic value, etc)



  • 5.  RE: How to read a file with URL encoding in the file name

    Posted Oct 23, 2014 08:31 AM
      |   view attached

    Using Internet Explorer or the Tortoise SVN Repo Browser (the files are in a Subversion repository) I can open the files.  If I copy the files to a local directory then specify the full path I can open the files.  It is when I try to read them using a URL that I have issues.

    I have tried hard coding the URL, as shown in the attached screen shot, and I have populated a Text variable with the URL and then pointed the Path And File Name parameter to the variable.  Neither approach was successful.  As I said before, if I am reading a file that does not include the %20 characters in the filename, the Read File component works.   

     

     

     

    Attachment(s)

    docx
    ReadFile Editor.docx   25 KB 1 version


  • 6.  RE: How to read a file with URL encoding in the file name

    Posted Oct 23, 2014 10:43 AM

    From a quick Google query about Subversion and problems with spaces in URLs, it looks like there are issues with spaces in filenames when browsing SVN resources.  I'm not wrapping my head around how this could affect the Read File component, unless the internal SVN website somehow isn't handling the URL request exchange properly.  

    Perhaps someone else can comment further on a possible Workflow deficiency, but using Workflow version 7.5.3001.64, I was unable to replicate the issue; I was able to read files from a URL that contained spaces in the filename.

    Perhaps another useful test would be to make a copy of the file, move it to one of your Workflow directories, and place that URL in the read file component.  For example, I have a published workflow called "TestWebForm".  I copied a file containing a space in the filename to the "resource" directory on my machine here:

    "E:\Apps\Symantec\Workflow\WorkflowDeploy\Release\TestWebForm\resource\test test.txt"

    And then used the Read File component to pull the file using the URL:

    http://localhost/TestWebForm/resource/test%20test.txt



  • 7.  RE: How to read a file with URL encoding in the file name

    Posted Oct 23, 2014 10:47 AM

    I've found that if I replace the %20 with %2520 I am able to read the files.  The %25 is the URL Encoding for the percent sign. 

    At this point I'll take whatever works.

     

     

     

     



  • 8.  RE: How to read a file with URL encoding in the file name

    Posted Oct 23, 2014 10:58 AM

    http://www.redmine.org/issues/7505

    Glad you got it worked-around!