Jump to content
UBot Underground

Add item to list "Illegal characters in path"


Recommended Posts

I have used the $Get Files command to pull back a list of file names from a folder.

 

What I am trying to do is add the content of a single file contained in the folder to a list.

 

However, the following code returns the error "illegal characters in path".

 

However the $read file is fine.

 

 

add item to list(%article titles, $get files("{$special folder("Application")}\\articles\\{#project name}\\", "No"), "Delete", "Global")

set(#current article, $next list item(%article titles), "Global")

add item to list(%current article content, $read file("{$special folder("Application")}\\articles\\{#project name}\\{#current article}"), "Delete", "Global")

 

Thanks for any help.

Link to post
Share on other sites

Yes, that is what I thought, and I don't have any of there:

 

If I spell out the fields

 

$specialfolder (is the application folder) \ articles (is the folder) \ #project name (is the projectname set at the UI and is also the name of the folder where the articles are stored) \ #current article (is $next list item on a previously scraped $getfiles - Include path no).

 

So in theory where I have a folder called myfirstproject and two files 1.txt and 2.txt

 

I should get the following output from my Add item to list:

 

Application\articles\myfirstproject\1.txt

 

But instead I get a $read file error.

 

Is there a problem adding stuff to lists using the $read file command?

Link to post
Share on other sites

Yes, that is what I thought, and I don't have any of there:

 

If I spell out the fields

 

$specialfolder (is the application folder) \ articles (is the folder) \ #project name (is the projectname set at the UI and is also the name of the folder where the articles are stored) \ #current article (is $next list item on a previously scraped $getfiles - Include path no).

 

So in theory where I have a folder called myfirstproject and two files 1.txt and 2.txt

 

I should get the following output from my Add item to list:

 

Application\articles\myfirstproject\1.txt

 

But instead I get a $read file error.

 

Is there a problem adding stuff to lists using the $read file command?

 

 

Up anyone can help?

Link to post
Share on other sites
  • 1 year later...

It might be late to post a comment on this thread, but just in case other people having the same issue.

So I found out that you must save your file in ANSI encoding if you want to use file's content for directory path usage.

 

Somehow a strange invisible characters (?) appears on the very first part of the file content when you read a UTF-8 encoded it using $read file or $list from file functions. You can only see this characters using notepad++ with "Show all characters" option on. This will not be appear in other text editor (i.e. notepad).

 

I'm not sure if this is a bug, of a expected behavior for UTF-8 encoded file.

 

Hope it helps.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...