Giter Club home page Giter Club logo

Comments (10)

wysow avatar wysow commented on August 18, 2024 1

@djoos As it seems you managed to make it work in your "extension" https://github.com/escapestudios/EscapeGaufretteExtension, is it possible for you to make a PR based on this?

from gaufrette.

Uplink03 avatar Uplink03 commented on August 18, 2024 1

I've taken the liberty to integrate the temp file buffer functionality from EscapeGaufretteExtension into my own fork (but don't use this - see next comment): https://github.com/Uplink03/Gaufrette/tree/enhance/escape-gaufrette

I didn't take the OpenCloud changes.

I didn't put too much thought into it, so now the InMemoryBuffer isn't used and there's no option to select it. But maybe it helps somebody. If you review the changes and find them good for a PR, I'll make a PR.

from gaufrette.

djoos avatar djoos commented on August 18, 2024

Top tip when dealing with large file uploads to OpenCloud: make sure to define RAXSDK_TIMEOUT with a higher-than-default (default = 30) value.

eg.

define('RAXSDK_TIMEOUT', 1800);

Hope this helps!

Kind regards,
David

from gaufrette.

geoffreytran avatar geoffreytran commented on August 18, 2024

I am having the same issue with handling large file uploads. All adapters that do support resource write() call Util/Size which uses mb_strlen to determine content size. This should be avoided.

from gaufrette.

wysow avatar wysow commented on August 18, 2024

@djoos Is this still relevant?

from gaufrette.

djoos avatar djoos commented on August 18, 2024

Hi @wysow,

yes, the issue is still relevant: AFAIK the file content is still kept in memory in the bundle when not using our tempfile workaround (see above)...
This is an issue when handling (very) large file uploads...

Hope this helps!

Kind regards,
David

from gaufrette.

djoos avatar djoos commented on August 18, 2024

Definitely, I'll keep you updated!

from gaufrette.

SrgSteak avatar SrgSteak commented on August 18, 2024

Is there working build available now?

from gaufrette.

djoos avatar djoos commented on August 18, 2024

Hi @SrgSteak,

I haven't got round to starting the work of getting our "extension" into Gaufrette...

However, I haven't forgotten this thread!

Kind regards,
David

from gaufrette.

Uplink03 avatar Uplink03 commented on August 18, 2024

UPDATE: DON'T USE THIS CODE. It's introduces an incompatible API change. Just check out what happens in TempFileBuffer's flush method: the content is the temp file's filename. Without reviewing the OpenCloud changes, I'm gonna say that they address this behaviour, but if you go and use, say, S3, you get the temp file's filename instead of the content.

While researching this I noticed that I can pass fopen handles to filesystem->write, so I can replace all file_get_contents with fopen and get rid of the memory issues. Both AwsS3 and Local adapters accept this usage, and I would suggest it gets documented and expected across the board from all other adapters.

This also means I don't need to use streams at all.

A few days ago I said:

I've taken the liberty to integrate the temp file buffer functionality from EscapeGaufretteExtension into my own fork: https://github.com/Uplink03/Gaufrette/tree/enhance/escape-gaufrette

I didn't take the OpenCloud changes.

I didn't put too much thought into it, so now the InMemoryBuffer isn't used and there's no option to select it. But maybe it helps somebody. If you review the changes and find them good for a PR, I'll make a PR.

from gaufrette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.