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 = 2.7.5.7166

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 png..no file extension), the upload would work!

Prod02 server:

af sdk = 2.7.5.7166

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

OSIsoft.AF.Asset.AFFile.Upload("logo.png",filestream)

 

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.

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

   at
System.IO.Path.GetFileName(String path)

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

Outcomes