CSV downloaded via curl is zero bytes

RogerH
Contributor II

Hey JamfNation I am hoping someone can assist me here. We are using the jamf command setcomputername fromfile and I have a csv with 400+ entries of serials and computer names. I have uploaded the file to a webserver running iis7 and use

curl -O https://webserver/filename.csv

the file that gets outputted has zero bytes. What am I doing wrong here? PLEASE HELP!

for info the Mime type is set to application/octet-stream which is default for IIS and I have verified the permission on the file

4 REPLIES 4

mm2270
Legendary Contributor III

I've never used that kind of syntax with curl before. While technically it should work according to the man page, I would probably try something like this:

curl https://webserver/filename.csv -o /tmp/filename.csv

I'm not clear if you need to add any flags after curl, like a header or something else. You'll need to experiment with that. Also, I see that it's an https server. Do you need to provide authentication for it to work? Like -u username:password perhaps?

thoule
Valued Contributor II

I could change the mime type to text/plain for CSV on your ISS server. Can you get it with a web browser with the same URL? What's in your ISS error log?

RogerH
Contributor II

I’m an idiot it’s an https site I was getting a 302 redirect all better now

RogerH
Contributor II

I had he command http 🤦‍♂️