laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 31 forks source link

Filesystem S3 Append is removing tags #2627

Open pawan1793 opened 3 years ago

pawan1793 commented 3 years ago

When appending data via s3 filesystem tag which is assigned to file is getting removed ... This might because of append is calling put method with empty options

/**
     * Append to a file.
     *
     * @param  string  $path
     * @param  string  $data
     * @param  string  $separator
     * @return bool
     */
    public function append($path, $data, $separator = PHP_EOL)
    {  
        if ($this->exists($path)) {
            return $this->put($path, $this->get($path).$separator.$data);
        }

        return $this->put($path, $data);
    }

Is there any other way to preserve tags which are already present in object

//tag is added properly $storage->put($path, $data',[ 'Tagging' => 'type=xyz']);

//same tag is getting removed when calling append $storage->append($path,$data);

Laravel version 8.0