When you find error in line import org.eclipse.jetty.server.Server;
it means eclipse doesn't contain jetty.jar.
Right click on project -> properties
on left pane -> java build path
right pane -> add external jar under libraries tab
link it to all the jar files of jetty folder.
can download jetty from : http://www.eclipse.org/jetty/downloads.php
now rebuild the project.
This post is about uploading a file to server using curl. Why I'm writing this post is because of a possible bug in Postman which forced me to look for an alternative to test my upload api. Test if curl is present in system : $ which curl /usr/bin/curl If curl is not present then install it : yum (centos), apt-get (ubuntu), brew (mac) Syntax of the command : curl -F "param1=value" -F "param2=value2" -F "filecomment=file_comment" -F "image=@image_path" server_api Here's an example of the same : curl -F "user_id=12" -F "description": "desc" -F "filecomment=This is an image file" -F "image=@/Users/Desktop/testim.png" localhost:80/myblog/create If using nodeJs, you can fetch the values in fields & files parameters.
Thanks for giving the steps.
ReplyDeleteThanks alot!!
ReplyDelete