Comments (5)
Hi,
When you upload the file in your Windows system do you by chance have the file still open? Windows has the behavior of creating temporary files when the file is currently open and potentially being edited. The temp files are closed and deleted once Word is shut down. If you do have it open can you try closing the file and then try uploading? Here is some documentation on the behavior: https://support.microsoft.com/en-us/help/211632/description-of-how-word-creates-temporary-files
Also are you able to upload raw files with our upload method (rather than upload_large) without the tmp extension being added?
Regarding Ubuntu appending random characters at the end, we do this by default to ensure a unique filename. However if you'd like to turn this behavior off you can include the parameter unique_filename = false
upon the upload call and this should stop the random characters from being added but please keep in mind this will overwrite an existing file if they have the same public ID. If you'd like to read more about this you can do so in this article: https://support.cloudinary.com/hc/en-us/articles/202520762-How-to-upload-images-while-keeping-their-original-filenames-
Hope this helps!
from cloudinary_php.
Thanks for your reply - I definitely don't have the file open - however upload_large itself does create a temporary copy of the file in the system's temp folder
cloudinary_php/src/Uploader.php
Line 101 in 46546ac
Regarding the random characters, my first thought was that Cloudinary was doing this - however, if that's the case, then Cloudinary is adding the random characters directly to the extension, and then complaining that the extension is not on the whitelist. For example, when I run this script on our Ubuntu server, the error looks like this:
Array
(
[error] => Array
(
[message] => Raw file format txtf5hg9 not allowed
[http_code] => 400
)
)
Note that the first 3 letters are indeed the extension of the file I provided (a text file), but the last 5 aren't mine. It seems unlikely Cloudinary would add those extra characters before the file has even uploaded, and then reject the file because of the characters it added. So I think this might be coming from the operating system giving the temp file a unique name, in the same way I see the .tmp extension on Windows. I can't think of how else the filename would be getting changed. And while that wouldn't directly be the fault of the SDK, it should take that into account, or uploads just stop working.
I'm not able to check right now, but yes, I believe the regular upload works.
from cloudinary_php.
Hi,
I did some testing and it does look like the upload method works in case that is a suitable workaround in the meantime. I will be filing this as a bug and will update you once we have made the necessary changes. Thank you for bringing this to our attention.
from cloudinary_php.
Want to konw,the question is resolve or not ?
from cloudinary_php.
Hi @GerberaLee, I apologize for the delayed update but this has been resolved.
from cloudinary_php.
Related Issues (20)
- PHP 8.1 support HOT 5
- Migrate from Travis to GitHub actions HOT 2
- Add PHPStan HOT 1
- Wrong CLOUDINARY_URL HOT 3
- Why does the response I'm getting not reflect the documentation's format? HOT 5
- Missing a way to easily request every asset type HOT 18
- Deprecated: fopen(): Passing null to parameter #3 ($use_include_path) of type bool is deprecated (php 8.1) HOT 1
- Update access mode method not available in SDK HOT 10
- [2.7.1] Why separate package and failure on composer-require-checker HOT 1
- Fatal Error on PHP 7.4 HOT 2
- Bad signature when public id contains commas HOT 5
- Error using defaultvalues in class SetMetadataField HOT 1
- Incorrect URL generated when Public ID of MediaAsset ends with dot + 1-5 characters HOT 3
- ${var} -> {$var} for PHP 8.2 compatibility in version 1.x HOT 5
- Deprecations on PHP 8.2 HOT 1
- Call to undefined function GuzzleHttp\Promise\promise_for() HOT 3
- Get rid of `teapot-php/status-code` dependency HOT 9
- Drop Guzzle requirement and replace with any PSR-18 HttpClient
- Use named parameters instead of array in Version 3 HOT 1
- Class 'Cloudinary\ClassUtils' not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudinary_php.