Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Security with Uploading CSV to update databaseby dws (Chancellor) |
on Aug 12, 2002 at 21:11 UTC ( [id://189632]=note: print w/replies, xml ) | Need Help?? |
... a script which can be used to browse for a CSV, upload it, and execute a mySQL update using it's contents.
Could you expand on this a bit? As stated, I can read this two ways*. One is that the files being browsed for are on some local user's machine (e.g., using a file upload form), and that they're uploaded to a server where they're using to update a MySQL database. The other is that they're browsed from on the server, and are uploaded to a client workstation that has a MySQL database. Assuming the former, you could use CGI.pm to handle a file upload, and then use TextCSV to pick it apart, loading it into MySQL. These are nicely separable problems. The security problem you have to deal with is someone uploading bogus data. You can approach this either by restricting who can upload data (e.g., using the .htaccess method you propose), or by rigorous checking of the data before updating the database, or both. *Learning to read requirements in conflicting ways is a useful skill for staying out of trouble.
In Section
Seekers of Perl Wisdom
|
|