Reputation: 35
i want to implement an idea but i don't know if it's possible, need your advices.
so , i created an excel file with custom validations, i want the users to download that exact same file , fill in their data, and then upload this same file in the application again.
so to make sure that it is the same file that was downloaded from my website. i want to secure it with a key ( or unique token maybe) and then checked it in the backend once uploaded.
is there any possible way to do this ?
ps : i'm using laravel 10
thank you.
i've searched a lot, but didn't find any helpfull answers. i really need your help
Upvotes: 0
Views: 75
Reputation: 343
Yeah, it's possible. I don't think it's particularly useful though, since the user could download the file, grab the verification key, then upload whatever they wanted as long as the verification key was in the same spot. If you just want really rough validation, it should work.
The approach would be something like this:
Then when they upload the file, do it in reverse.
PhpSpreadsheet
to load the UUID.Or, if you don't care about weird filenames, you could store it in the filename instead, in which case it's even easier because you can validate it from the filename instead of having to parse data. But then it's even easier to manipulate, since the user could upload a JPEG with the filename UUID-HERE.csv
.
Upvotes: 0