Greetings,
I am a newbie in web development and I am working on a website backend using ASP.NET, Bootstrap, and jQuery and I need to upload files, simply photos, that will be used to be displayed on the frontend banners. I already used the HTML5 file API to read the files from the local system what I need right now is to know how can I send those read files to the server?! Do I have to implement some sort of ASP.NET Web API, as I am using ASP.NET already, that will be responsible for doing the storing functionality. If that is the case do I have to know the server IP address and port number to specifiy them when calling post method http://server-ip:port/myapi/mycontroller or I can simply use something like ./myapi/mycontroller ?!!!

Greetings,

I am so gratefull to you and your help. My problem was in how to send the data from the HTML page to the server. I have read about the HTML 5 file API and I used it to read the file from the machine my problem, even when downloading plugins, is how to send the data I have read to the server to save it. When using the classic way of the ASP.NET you were using the Server.MapPath method and a server control. But the case here is different as you are using a client side control. What I was need indeed, is how such client side control will send its data to the server that its all and I figured out that I have to use even ajax or the post method and specify the url of the web api route but my problem was that will that url will be in the form of server-ip:port number/api/xxxxxx or it will be in the form of servername/api/xxxxxx. I hope that my point of view is clear

Best Regards

It can be in either way... server-name or server-port should both end up on the same server. The server can be configured to only accept one or another, but usually it's accepted both.

Just to be clear, even if the request is made by a domain (or server name), then the DNS servers come in to find out the IP of that domain, but in the end what matters is the IP of the server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.