Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Data Types
For this first example, we’ll create an application that will store images of each product.
Because these files are small, we’ll opt to store them in SQL Server.
In SQL 2000, there were two different families of data type options for these type of files, binary, and image.
The Binary family includes three different data types.
The Binary data type itself, which requires a fixed size.
For this first example, because our images vary in size, we’ll use the varbinary data type, the “var” standing for variable.
The varbinary data type has a maximum length of 8,000 bytes.
Starting in SQL 2005, “varbinary(max)” was included in the binary data type family.
The keyword MAX indicates the size is unlimited.
If the SQL version is before 2005 and the file size is greater than 8,000, then the Image data type can be used.
It’s a variable size type with a maximum file size of 2GB.
Although the Image data type is included in SQL 2005 and SQL 2008, it shouldn’t be used.
Microsoft says it’s there for backwards compatibly and will be dropped at some point in the future.
Therefore, this example will use the Binary type, the three versions of which are recapped below:
Binary: Fixed size up to 8,000 bytes.
VarBinary(n): Variable size up to 8,000 bytes (n specifies the max size).
VarBianry(max): Variable size, no maximum limit.