Home > Back-end >  Questions about springboot upload file
Questions about springboot upload file

Time:03-25

1, springboot uploading files also need to configure any rely on?
2, file the save to where? Later to publish to the server, to ensure that the project does not affect the upload and echo after release, give some advice?

CodePudding user response:

Start module of the web, you don't need you to additional import;
As for preservation, way too much, the server disk have, use the cloud storage, too

CodePudding user response:

1. Assuming that save the path to the server, so you need to set up a server to save address (local) is a local disk address
2. Save time use save address + file path, file name, save to the corresponding address
3. The deposited in the database, it is best to use the relative path is the path to the file + file name, convenient late migration
4. The last to the server to make a forwarding, sprintboot static resource configuration, direct access url + database to store relative path

I doubt that you didn't understand, you can come step by step

CodePudding user response:

references a 3-yellow reply 2 floor:
1. Assuming that save the path to the server, then you need to set up a server save address (local) is a local disk address
2. Save time use save address + file path, file name, save to the corresponding address
3. The deposited in the database, it is best to use the relative path is the path to the file + file name, convenient late migration
4. The last to the server to make a forwarding, sprintboot static resource configuration, direct access url + database to store relative path

I suspect that you didn't understand, you can step by step to



Is really, is there any related cases refer to? I was thinking to save on a local disk, but will later published to the server can not find a file?

CodePudding user response:

references a 3-yellow reply 2 floor:
1. Assuming that save the path to the server, then you need to set up a server save address (local) is a local disk address
2. Save time use save address + file path, file name, save to the corresponding address
3. The deposited in the database, it is best to use the relative path is the path to the file + file name, convenient late migration
4. The last to the server to make a forwarding, sprintboot static resource configuration, direct access url + database to store relative path

I suspect that you didn't understand, you can step by step to


There is a kind of practice is saved to the project directory? I don't know this way feasible?

CodePudding user response:

reference program, 4/f, Yang response:
Quote: refer to the second floor of a 3-yellow reply:
1. Assuming that save the path to the server, then you need to set up a server save address (local) is a local disk address
2. Save time use save address + file path, file name, save to the corresponding address
3. The deposited in the database, it is best to use the relative path is the path to the file + file name, convenient late migration
4. The last to the server to make a forwarding, sprintboot static resource configuration, direct access url + database to store relative path

I suspect that you didn't understand, you can step by step to


There is a kind of practice is saved to the project directory? I don't know this way feasible?


After done, only incremental release, problem is very much

It is best to deploy a file server alone, with a domain name, all file save here
More like a database, share a DB server applications
  • Related