FTPWebRequest & AS/400 - Setting NAMEFMT to 1

I'm trying to connect to a FTP AS/400 server using .NET, with a url like this:


I'm getting a 501 error in return, and according to this question it's due to the path separator or AS/400 not working with regular paths without setting NAMEFMT to 1.

Since I'm using the FTPWebRequest object, is there any way I can set NAMEFMT to 1 with a FTPWebRequest?

-------------Problems Reply------------

You need to send SITE NAMEFMT 1 as a QUOTE command.

See this related question: How to send arbitrary ftp commands in C#. It doesn't appear to be possible using FTPWebRequest.

Take a look at libcurl.NET.

Alternatively if you can force FTPWebRequest to make the 'first' file or pathname parameter received in a subcommand start with a slash (/) or a tilde (~) character the system will automatically enforce NAMEFMT 1. See File systems and naming conventions under the FTP reference information topic in the IBM i information center.

Category:.net Views:2 Time:2012-01-03

Related post

  • FtpWebRequest Connecting to an AS/400 2009-12-18

    I need to download some files via ftp from an old AS/400 server. My code looks more or less like: FtpWebRequest _request = (FtpWebRequest)WebRequest.Create("ftp://ftpaddress/FOO.CSV"); _request.Credentials = new NetworkCredential(_ftpUsername, _ftpPa

  • FTP UPLOAD to AS/400 from VB.NET 2010-11-23

    I am attempting to perform a FTP Put function to an AS/400 IBM Mainframe with VB.NET. I am able to upload a file however, I need to be able to capture each output response from the mainframe for logging purposes. In short capture what prints out on t

  • How do indicate the SQL default library in an IBM iSeries 2 connection string to an AS/400? 2008-09-17

    I'm connecting to an AS/400 stored procedure layer using the IBM iSeries Access for Windows package. This provides a .NET DLL with classes similar to those in the System.Data namespace. As such we use their implementation of the connection class and

  • Custom error page configured in IIS for code 400 (bad request) is ignored 2008-11-06

    For my website I configured some custom error pages. If I generate a 404, the redirect works fine. When hitting a 400, the "bad request" text shows up instead of the configured URl. As a test I copied the URL from 404 to 400. No change. Then I change

  • How do you change directories using FtpWebRequest (.NET)? 2008-12-01

    Can someone tell me how to change directories using FtpWebRequest? This seems like it should be an easy thing to do, but I'm not seeing it. EDIT I just want to add...I don't have my heart set on FtpWebRequest. If there's a better (easier) way to do F

  • Can an ASP.NET HttpHandler handle an http 400 - Bad Request? 2008-12-04

    We have an HttpHandler that deals directly with binary posts over HTTP from custom client software. The client software occasionally sends data which results in IIS 7 responding with a 400 - Bad Request. Since the "400 Bad Request" is special in that

  • How to check if file exists on FTP before FtpWebRequest 2008-12-07

    I need to use FtpWebRequest to put a file in a FTP directory. Before the upload, I would first like to know if this file exists. What method or property should I use to check if this file exists? --------------Solutions------------- var request = (Ft

  • Apache giving a 400 Error on a FastCGI VirtualHost 2008-12-21

    Apache is spitting out a HTTP response of code: 400 "Bad Request" with no details whenever I access a page driven that is handled by a FastCGI script. I've installed the mod_fcgid module and it's loaded and configured in the Apache config files I've

  • Fresh WAS-CE installation gives nothing but "HTTP 400 'bad request'"? 2009-01-26

    I apologise in advance for something I'm expecting is a horrifyingly noob-question. I decided to try out developing web-applications in Java, using IBM's WAS-CE platform. I've never worked with this platform before, nor any other platforms for runnin

  • Why doesn't FTPWebRequest, or WebRequest in general accept a /../ path? 2009-01-26

    I am trying to automate some upload/download tasks from an ftp web server. When I connect to the server through client, or through Firefox even, in order to get to my directory, I have to specify a path like this: ftp://ftpserver.com/../AB00000/incom

  • ASP.NET C# upload MemoryStream content via FTPwebRequest issue 2009-02-12

    This should be pretty straight forward, and uploading works. BUT when I open the uploaded file on the FTP server it shows binary data which is just some weird characters that look like this [][][][], and its the right file size. how do I add attribut

  • HTTP 400 returned while accessing SQL Server 2005 Reporting Services Report Manager 2009-02-16

    I have a new SQL 2005 reporting services installation and it doesn't work. Database access works fine. I've setup a new IIS site, set it to run on port 90. It has the two virtual folders - Reports and ReportServer. I can access ReportServer just fine

  • Why does my C# client, POSTing to my WCF REST service, return (400) Bad Request? 2009-02-22

    I'm trying to send a POST request to a simple WCF service I wrote, but I keep getting a 400 Bad Request. I'm trying to send JSON data to the service. Can anyone spot what I'm doing wrong? :-) This is my service interface: public interface Itestservic

  • Bad Request (400): Why? 2009-03-12

    Why do I get a 400 - bad request error using the following URL? It is encoded using Server.UrlEncode. The actual path query parameter is C:\Development\Chase\Exports\ChaseExport-090312073930.zip http://localhost:50199/Common/Forms/Export_Stream.aspx%

  • How do you htdigest 400 user accounts? 2009-03-14

    How do you generate user accounts for 400 users to do a load testing? Htdigest forces you to type in a password each time, I have tried dos pipes like echo password > htdigest -c realm username%1 htdigest -c realm username%1 < password.txt but

  • .Net HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returned 2009-03-28

    I am in a situation where when I get an HTTP 400 code from the server, it is a completely legal way of the server telling me what was wrong with my request (using a message in the HTTP response content) However, the .NET HttpWebRequest raises an exce

  • Why Does my HttpWebRequest Return 400 Bad request? 2009-03-31

    The following code fails with a 400 bad request exception. My network connection is good and I can go to the site but I cannot get this uri with HttpWebRequest. private void button3_Click(object sender, EventArgs e) { WebRequest req = HttpWebRequest.

  • C# - Decoding Data From an AS/400 iSeries 2009-04-06

    I am using the standard .NET OdbcConnection to connect to an AS/400 iSeries database. I am able to query this database. Unfortunately, there are some fields that appear to be encoded. How do I decode these values in C#? I have tried the following: st

  • HTTP 400 : detected invalid characters in the URL. IIS decoding URL too early? Whats going on here? 2009-05-01

    So i have this URL: http://test.com/afolder/who-else-wants-to-make-horror-movies%3f/ which is URL encoded version of : http://test.com/afolder/who-else-wants-to-make-horror-movies?/ But IIS7 throws a 400: HTTP Error 400.0 - Bad Request ASP.NET detect

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.165 (s). 11 q(s)