TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Divyang Desai
Tech Writer
6.2k
534.8k
How to save json file to the FTP location without saving
Apr 20 2018 5:53 AM
Hi,
I'm trying to create and store Json file to the server each time with different name(using windows services), without saving on my application it should directly store to FTP location.
I have tried as following
string ftpAddress =
"http://dev-web/hrm/assets/"
;
string username =
"developer"
;
string password =
"123"
;
WebRequest request = WebRequest.Create(ftpAddress);
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials =
new
NetworkCredential(username, password);
string currentDirectory = Path.GetDirectoryName(
new
Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
using
(var sw =
new
StreamWriter(request.GetRequestStream()))
{
sw.Write(jsondata);
sw.Flush();
sw.Close();
}
This code doesn't work and neither giving me any error. I just want to know how to give particular name to the files.
Reply
Answers (
0
)
Issue With File name
How to get encrypted parameter(class object ) in web api?