Very new to ASP.net MVC and C# in general. Experience with PHP/NodeJS mostly, a little Java.
I have a method in a controller like so:
public ActionResult ImageProcess(string fileName){
string url = "http://myurl.com/images/" + fileName + ".jpg";
//Code to stream the file
}
And when I navigate to it as "http://myurl.com/Home/ImageProcess/12345" I get thrown a 404 error by the process as it's trying to fetch the file.
If I hard-code it like so...
public ActionResult ImageProcess(string fileName){
string url = "http://myurl.com/images/12345.jpg";
//Code to stream the file
}
...It works just fine, returns my processed image as expected.
Why is this happening?
ImageProcessaction, or a later request to theurlvalue? The description makes it sound like the latter. If that's the case, then what is the value ofurlthat causes the error?fileNamebeing returned as null? Not sure how you're attempting to set the parameter, but if it's in a form, the issue could be a number of things, including not having an input with thenameoffileName.