Reputation: 2821
I want to send a file to a server using Javascript on the client end and a perl cgi script on the server. And well I don't know where to start.
This is what I understand that I need to do; open the file read it, pass it to the server as the request body, pull the file out of the request body at the server end.
So any one know a good way to do this? also if I have got any of the basics wrong please let me know.
Upvotes: 0
Views: 1816
Reputation: 17238
I'd recommend using jquery client-side and CGI.pm server-side. The following resources will provide details:
data
attribute will be reader.result
in your case (adopting the variable names from the code examples in the linked tutorial).
just keep in mind to call reader.readAsText
to make the file contents available to javascript.drop a comment if you need more support to get your job done. the explanations and the sample code in the cited docs are actually pretty good. Also have a look at the answer to the question Quentin ref'ed if you haven't yet done so. regards
Upvotes: 1