ASCII Mode on Server

Please post here if you have problems in using Wing FTP Server.

ASCII Mode on Server

Postby AccentureDan » Tue Dec 24, 2013 11:03 pm

Is there a way to force the server to accept ASCII data transfer? Trying to do so with an IBM mainframe client (FTPS, mainframe is connecting to our Wing FTP Server) but I am being told we are listening to binary only.


posts 1
joined Tue Dec 24, 2013 11:00 pm

Re: ASCII Mode on Server

Postby FTP » Fri Dec 27, 2013 2:00 am

Yes, there is binary mode only, because Wing FTP Server won't change the content of the transferred file.

Anyway, you can use Event Manager to handle such requirement, just input the below Lua script into the event "OnFileUploaded":

Code: Select all
local fname = string.gsub("%PathName", "\\","/")
local ext = string.sub(fname,1-string.find(string.reverse(fname),"%."))
local types = "|am|asp|bat|c|cfm|cgi|conf|cpp|css|dhtml|diz|h|hpp|htm|html|in|inc|js|jsp|m4|mak|md5|nfo|nsi|pas|patch|php|phtml|pl|po|py|qmail|sh|shtml|sql|svg|tcl|tpl|txt|vbs|xhtml|xml|xrc|ini|log|java|lua|log|"

if string.find(types, "|"..ext.."|") then

   local fp = assert(, "rb"))
   local content = fp:read("*all")

   content = content.gsub(content, "\r\n", "\n")
   content = content.gsub(content, "\r", "\n")

   local fp = assert(, "wb"))

Site Admin
posts 1565
joined Tue Sep 29, 2009 6:09 am

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests