Options

Json upload in FTP

smishrasmishra Member Posts: 28
Hello,

I have upload the .JSON file in FTP server but system return the error.
error is 'A call to System.Net.FtpWebRequest.GetRequestStream failed with this message: The requested URI is invalid for this FTP command.'
what is the reason behind this.

Please reply asap.

thanks

Answers

  • Options
    RockWithNAVRockWithNAV Member Posts: 1,139
    Can we see your code how exactly you uploading?
  • Options
    smishrasmishra Member Posts: 28
    I have write the code which line an issue.
    UploadJSon('API Path','userid','Password',Json) //Json is the .net variable store a json file

    UploadJSon(WebServiceURL : Text;UserName : Text;Password : Text;VAR String : DotNet "System.String")
    CreateWebRequest(HttpWebRequest,WebServiceURL,'POST');
    CreateCredentials(HttpWebRequest,UserName,Password);
    SetRequestStream(HttpWebRequest,String);
    DoWebRequest(HttpWebRequest,HttpWebResponse,'');
    GetResponseStream(HttpWebResponse,String);

    i have an issue in this function
    SetRequestStream(HttpWebRequest,String);
    StreamWriter := StreamWriter.StreamWriter(HttpWebRequest.GetRequestStream,Encoding.GetEncoding('ISO-8859-1')); // i have also use' UTF-8'
    StreamWriter.Write(String);
    StreamWriter.Close;

    bold line has an error.

Sign In or Register to comment.