nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Percivall <>
Subject Re: File Upload to a ListenHTTP Processor
Date Fri, 05 Feb 2016 23:34:49 GMT
Hello Andrew,

I believe I was running into something similar before and my problem was actually with the
curl command itself. When I added "--data-binary" to the command it worked.

Relevant SO question:

- - - - - - 
Joseph Percivall

On Friday, February 5, 2016 5:30 PM, Andrew Serff <> wrote:

Hello, I’m new to NiFi, and I’m just trying out my options for ingest into a data flow
we are trying to set up.  We want to expose both the capability to SFTP a file into a dropbox
or perform an HTTP File Upload. So I’ve set up both a GetFile and ListenHTTP processors.
 After both processors, I just add a success relationship to a PutFile processor to write
the file to an archive directory.  The dropbox works as expected, however the ListenHTTP processor
isn’t working quite as I’d expect it to, so I’m hoping someone can point out what I’m
doing wrong.  

As a simple case, I just set up a ListenHTTP processor and have it listening on port 8080
at the “ingest” context.  So I can hit it at http://localhost:8080/ingest. No security
or anything yet. Then from the command line, I’m trying to upload file like so:

curl -i -X POST -H "Content-Type: multipart/form-data" -H "filename: maven-4.0.0.xsd" -F "data=@maven-4.0.0.xsd"

The file is uploaded and written to the directory, however it is wrapped with the form encoding.
 So the beginning of the file now looks like:

Content-Disposition: form-data; name="data"; filename="maven-4.0.0.xsd"
Content-Type: application/octet-stream

<?xml version="1.0"?>
<!-- =================== DO NOT EDIT THIS FILE ====================         -->
<!-- Generated by Modello 1.8.3,                                            -->
<!-- any modifications will be overwritten.                                 -->
<!-- ==============================================================         -->
<xs:schema xmlns:xs="" elementFormDefault="qualified" xmlns=""
  <xs:element name="project" type="Model">

Obviously the file is no longer a valid xsd file nor the same as what was sent from the source
system. I used an xsd file just for testing, but we could have any type of file (binary, text,
what have you…). I have also tried this same upload using a Java client and I get the same

Can anyone let me know how we can get this to work? 

View raw message