c# - is this possible to create subdirectory in FTP using ftp.MakeDirectory? -


i have create query answer before change code.pardon me if question doesn't make sense guys.

scenario 1:

string path :ftp://1.1.1.1/mpg/test"; ftpwebrequest requestdir = (ftpwebrequest)ftpwebrequest.create(new uri(path)); requestdir.credentials = new networkcredential("sh","se"); requestdir.method = webrequestmethods.ftp.makedirectory; 

using same code create directory structure connect local filezilla ftp server job---works fine.

scenario 2: used above code connect remote ftp server same job throws exception : error 550 no file found or no access.

question 1 : have full permission read/write folder,if not permission issue,what else have keep in mind ?

question 2: if modified code step1: make"mpg" direcotry first step2: make"test" directory after that,works fine mean ftp.makedirectory won't support create subdirectory in main dir ?

if that's case how created in local ftp server ?

any appreciated.

thanks in advance.

i dont know why exactly, ftp servers response differently. know because scenario happened me while developing dropf. if using filezilla ftp server, create subdirectories working, not on iis ftp server.

so suggest write 1 method creating directory, method takes 1 parameter ant full path, in scenario (mpg/test), , split '/' , create 1 one every directory. way works on filezilla , iis ftp , other ftp services.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -