File Metadata Microservice Challange `name` `upfile` fail

I have completed the File Metadata Microservice Challange in API and Microservices course. But when I submit my solution link I am getting following two test fail causes crankily:

  • You can submit a form that includes a file upload.
  • The form file input field has the name attribute set to upfile .

Everything seems ok as you can see in my source code. I cannot understand the problem. Thanks in advance for your help!

Your project link(s)

solution: https://elvinbashirlisportfolio.herokuapp.com
githubLink: GitHub - ebashirli/elvinbashirlisportfolio

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36.

Challenge: File Metadata Microservice

Link to the challenge:

Hello there,

Are you aware you need to be submitting the link to the specified app? In your case:

  • https://elvinbashirlisportfolio.herokuapp.com/file-metadata

When I do that, the last test fails with this error:

POST https://elvinbashirlisportfolio.herokuapp.com/file-metadata/api/fileanalyse 404 (Not Found)
SyntaxError: Unexpected token < in JSON at position 0

I have not dug, but my best guess is, with your current structure, your routes are not correct. Specifically, I suspect you need have a route /api/fileanalyse, but not the needed /file-metadata/api/fileanalyse.

You have 2 options:

  1. Refactor to have the route /api/fileanalyse target just the file-metadata page (simple one-liner middleware)
  2. Add /file-metadata to the beginning of the route

Now that I say that, they are doing the exact same thing, but for multiple routes, you would want to do 1.

Hope this helps

1 Like

Thanks for contributing.
I used the same code for all other 4 porject, so that I wrote all projects as a single one. It has worked for all other 4, but not last one. The link that I provided passes even the first and last tests but not middle ones.
I solved the problem by writing it in Repl.it and providing link from it. But stil I’d like to solve with this link and see what is wrong.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.