Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File uploaded to Azure is empty #6

Open
mikewop opened this issue Jan 22, 2019 · 0 comments
Open

File uploaded to Azure is empty #6

mikewop opened this issue Jan 22, 2019 · 0 comments

Comments

@mikewop
Copy link

mikewop commented Jan 22, 2019

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

run the application/file phpQS.php

Any log messages given by the failure

none

Expected/desired behavior

the file HelloWorld.txt uploaded to Azure Blob storage should have the text "Hello Azure!" in it, but it is empty.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Windows 10 Professional

Versions

Mention any other details that might be useful

On line 84 in phpQS.php the call to open the file in "write" mode will essentially truncate the file contents (http://php.net/manual/en/function.fopen.php ):
$myfile = fopen($fileToUpload, "w") or die("Unable to open file!");
Thus when the file is subsequently uploaded to Azure it will be empty.
Since the intention is just to see if the file exists/can be read, the fix would be to use the "read" flag on line 84:
$myfile = fopen($fileToUpload, "r") or die("Unable to open file!");


Thanks! We'll be in touch soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant