Expand my Community achievements bar.

Writing to a file with a special character

Avatar

Level 4

Greetings,

I'm sort of "in training" using workbench and ran across a problem that involves writing to a file.  Essentially the process is this:

1. User uploads a file (e.g. "100% Carbs.doc")

2. Variables are set and trying to save the file using the process causes an error because of the % symbol (confirmed by removing the % and having it save perfectly).

So I was wondering if the % sign is a special character in workbench?  If it's not, why does workbench keep telling me there is a syntax error in the expression (/process_data/data/sFilename, where sFilename = 100% Carbs.doc)?

Thanks, and if any further explaination is needed, please let me know).

2 Replies

Avatar

Level 10

Yes, it is a special character.

The field is labeled "Pathname pattern" so you could use a pattern that contains a % in there. There is some code that checks for that special character and act accordingly.

Jasmin

Avatar

Level 4

Jasmin,

Thank you for your response.  We ended up just catching exceptions and telling the user to rename the file and attempt a re-upload.  This was possibly not the best solution, but we still couldn't figure out how to take in the %, set it in a variable, and then write to a file with that variable's name.

Thank you for your advice!

Alex