如何从没有(扩展名,类型,大小)字段的longblob mysql下载文件

I searched a lot about how to download files from longblob mysql but all the code requests (extension,type,size) and i do not make These fields and i do not want make it . SO, Is there any way to download any file type (jpg,gif,pdf,png,txt,ect..) from the database without (extension,type,size) fields ?

A couple things here:

  • Do NOT store files in the database. The database is for data, the file system is for files. The smart way to do something like this is to have a varchar storing /path/to/your/file.foo
  • Unless you plan to examine each file (costly and slow), you benefit GREATLY from just storing this data for re-use in the future

It's not a good idea to save a file in your database. It's an old tradition. Try to come outside. Save the file in the directory and after that save the file name or path in the database. This will decrease the load on the database and also decrease unusual use of the db storage