AnsweredAssumed Answered

AFFile.Upload() error "Illegal characters in path."

Question asked by ChewCheeLim on Aug 18, 2016
Latest reply on Aug 18, 2016 by Mike Zboray

Hi there,

in our production server (Prod01), we are experiencing this issue with AF sdk call while uploading .png & .gif file types. (I didn't try all graphics file types)

But if I upload xml file on the same production server, same method call, then the call will be successful.

Prod01 server :

af sdk =

AF server : 2.7



On another production server (prod02), -( yes we have 2 separate prod environments due to diff business entities)

I can use the same code to upload any files (including file extension), the upload would work!

Prod02 server:

af sdk =

AF server 2.6


Anyone can help me to pinpoint the problem? Currently this is a show stopper for clients using Prod01 server. Temp solution, manually uploading the png & gif file to server by using PSE instead of a custom program talks to af sdk.


Thanks much


SDK call



Error message :-

2016-08-18 12:49:55,324 [24] ERROR
EnergyMetrics.Services.Common.Common -  [Update]  ||Exception||:

Illegal characters in path.

System.ArgumentException: Illegal characters
in path.

System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

System.IO.Path.GetFileName(String path)

OSIsoft.AF.Asset.AFFile.Upload(String name, Stream stream)