Users to upload, please face images, deposited in the database in a binary way, ok? Login, and then back into binary read from the database to a local image,
However, the user avatar picture how to control the size? Including the size and file size, the total could not limit the size...
There's a better way?
CodePudding user response:
Have a file upload download service, this service can restrict file, the size of the picture is too big can compress image
In the database is not recommended
CodePudding user response:
reference 1/f, oh wow response: have a file upload download service, this service can restrict file, the size of the picture is too big can compress image In the database is not recommended I am using WCF, file upload, download, not whole oh, after the upload is in server hard disk? CodePudding user response:
Not tender is too big, but still there are some different size, set into a picturebox backgroupdimage his layout set to zoom CodePudding user response:
Will be limited when the upload file size, then the generated to display the size, it is not necessary to put in the database CodePudding user response:
The client to upload pictures need to request to its size and size, if you need to provide a convenient, must need to provide the function of capture images, In addition, the image upload must be deposited in the file on the server and the database file address, CodePudding user response:
I won't file upload and download, can in binary file save database, read to the local, deal with again, ok? What are the disadvantages CodePudding user response:
You can't file upload download how stored images, CodePudding user response:
refer to the second floor uncle tis response: Quote: oh wow reference 1 floor response: have a file upload download service, this service can restrict file, the size of the picture is too big can compress image In the database is not recommended I am using WCF, file upload, download, not whole oh, after the upload is in server hard disk? You can receive the binary data, the binary data is written to the hard disk is not a file, only need to read the file download, database is ready just need to record the file path After receiving the binary data can be transformed into BitmapImage or Bitmap object first, you can see pictures aspect, if width is too big, can compress the written to disk again As for image compression, there are many online can refer to https://blog.csdn.net/szstephenzhou/article/details/38900345 CodePudding user response:
Avatars can not control the size, if want to control, are just three size, you can zoom by oneself, without having to force users to meet your standards CodePudding user response:
I directly to you say the feasible methods: user image upload interface is just a Ui executive function, you need to do is 1: the early stage of the user data processing, is a Rectangle, fixed out form the underlying database, upload the back-end processing module, with reference to the Rectangle, 2: binary is not desirable, directly using the blob data type, do not need to use sqlerver. First you take the first step to understand, behind their can play,