The private Bucket storage of Qiniu is used. on The PHP server, set insertOnly to 0 to overwrite the code uploaded from the old image: {code ...} after the upload is successful, I obtain the image external link as follows: {code ...} then return the tag to the client, and update the src of IMG with JS, but still... the private Bucket storage of Qiniu is used. on The PHP server, set insertOnly to 0 to overwrite the old image.
Uploaded code:
$ Key = "123.jpg"; $ policy = array ('insertonly '=> 0); $ token = $ this-> auth-> uploadToken ($ bucket, $ key, 3600, $ policy); // Construct the UploadManager object $ uploadMgr = new UploadManager (); $ result = $ uploadMgr-> putFile ($ token, $ key, $ path); return $ result;
After the upload is successful, I obtain the image outer link as follows:
$baseUrl = $bucketDomain.'/'.$key; $authUrl = $this->auth->privateDownloadUrl($baseUrl); return $authUrl;
Then return the tag to the client, and update the src of IMG with JS.
However, the old images are still displayed. I am very grateful for how to solve this problem!
Reply content:
The private Bucket storage of Qiniu is used. on The PHP server, set insertOnly to 0 to overwrite the old image.
Uploaded code:
$ Key = "123.jpg"; $ policy = array ('insertonly '=> 0); $ token = $ this-> auth-> uploadToken ($ bucket, $ key, 3600, $ policy); // Construct the UploadManager object $ uploadMgr = new UploadManager (); $ result = $ uploadMgr-> putFile ($ token, $ key, $ path); return $ result;
After the upload is successful, I obtain the image outer link as follows:
$baseUrl = $bucketDomain.'/'.$key; $authUrl = $this->auth->privateDownloadUrl($baseUrl); return $authUrl;
Then return the tag to the client, and update the src of IMG with JS.
However, the old images are still displayed. I am very grateful for how to solve this problem!
Qiniu Cloud caches data, and platform management provides a data refresh specified uri to obtain the latest data.
I think you should generate$keyGenerate random parameters with some time (if no key is specified, Qiniu will randomly hash file name storage)