I think you have problem in middleware routes so follow this article

Check this article and follow steps for simple file uploading in php with ajax

if you have access to the command line, this would be easier

importing large text files using php probably uses too much memory

I think this article help you to build responsive shopping cart using php mysql with jquery.
Let's follow simple steps