0

I want users to be able to upload their own files to my server. When they choose a file it is converted to blob:. I then use ajax to post that data to a url. What I need to a PHP script that can take that information and store it on the server. I also want a custom name to be given to the image depending on the url posted to. Example:

www.phpscripturl.com/save&filename=picture

This would save the information posted to the server as a png file called picture

Density
  • 91
  • 1
  • 7
  • So, is "blob" a raw file content string then? What happens when you read it? Does the file saving not work? Or is the question about the filename / whitelisting it / or file_put_contents, or something else? – mario Aug 15 '15 at 14:28
  • @mario I'm asking for a php script to save the posted string as an img and name it based on the url given. I've done something like this before, but only for saving data to a database depending on the url. I've never found a way to save a blob file as an img. – Density Aug 15 '15 at 14:51
  • It's a one-liner `file_put_contents($fn, $blob);` really. So, unless you can concretize the specific issue you have, this is asking for guess-the-required-code. – mario Aug 15 '15 at 15:05

0 Answers0