how to copy a locally created file to azure file storage using PHP

rodolfo tuble 1 Reputation point

I'm trying to follow this link: with examples from this repo: The file is indeed copied to the azure server but the content aren't readable, to say the least, it takes a size but it's empty. This is only a text file as well, and what I plan to achieve after fixing this is to copy excel files generated via PHP to an azure file storage server.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,347 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,366 Reputation points

    Hi @rodolfotuble-4323,

    Are you getting any error messages or confirmation message that the file has been copied to the Azure server? When you say "not readable " what does that mean? you should get a 202 status code if the copy was successful.

    A few things to keep in mind:

    -If the destination file exists, it will be overwritten. The destination file cannot be modified while the copy operation is in progress.

    -The Copy File operation always copies the entire source blob or file; copying a range of bytes or set of blocks is not supported

    -The destination file is always the same size as the source blob or file, so the value of the Content-Length header for the destination file matches that for the source blob or file.

    Hope that helps.