Giter Site home page Giter Site logo

mkdir file exists about resumable.php HOT 13 CLOSED

dilab avatar dilab commented on July 22, 2024
mkdir file exists

from resumable.php.

Comments (13)

dilab avatar dilab commented on July 22, 2024

is there any particular error message you can provide for us to debug?

from resumable.php.

adadgio avatar adadgio commented on July 22, 2024

Hm, actually, the issue seems straight forward... file_exists > then mkdir ? Should be is_dir in my opinion ;-).

from resumable.php.

dilab avatar dilab commented on July 22, 2024

@adadgio
Hmmm, I think file_exists does check directory.

file_exists — Checks whether a file or directory exists

Refer to http://php.net/manual/en/function.file-exists.php

from resumable.php.

adadgio avatar adadgio commented on July 22, 2024

My bad, you are absolutely right @dilab !

Other suggestion which happened to me quite a few times... the function would return false when the file permissions are wrong (or if the server does not have them).

See also the warning section of http://php.net/manual/en/function.file-exists.php

I think this is it. Try to fix your permissions.

from resumable.php.

dilab avatar dilab commented on July 22, 2024

I think it makes sense.

We could throw an exception if file_exists return FALSE.

from resumable.php.

adadgio avatar adadgio commented on July 22, 2024

Yup. Right thing to do i guess.

from resumable.php.

wyklif avatar wyklif commented on July 22, 2024

this seemed to appear randomly it doesnt appear now however after deploying my code to a virtual machine i seem to get an error all of dillab backend methods dont work including Call to undefined method Dilab\Resumable::getExtension()
however it works very wel on my local development environment
please assist

this is my code

$request = new SimpleRequest();
$response = new SimpleResponse();
$resumable = new Resumable($request, $response);
$ext = $resumable->getExtension();

from resumable.php.

dilab avatar dilab commented on July 22, 2024

@wyklif is the server working for your other PHP codes? What is the server and PHP specs?

from resumable.php.

wyklif avatar wyklif commented on July 22, 2024

Yes the server is working before i first begin uploading i use intervention to get an uploaded image resize and save it that part is working fine so i am sure that composer autoload is working fine.. then the progress bar loads to the end then it fails with the above error. i am on ubuntu 14.04 on a lamp stack i ahve set upload file size to 5G post size to 5G maximum execution time to 3600 i am on php 5.6 im using laravel 5.3

from resumable.php.

dilab avatar dilab commented on July 22, 2024

Why are you calling $ext = $resumable->getExtension(); directly?

from resumable.php.

wyklif avatar wyklif commented on July 22, 2024

because i am generating a random name for an uploaded file then appending its extension so that the file is served correctly

from resumable.php.

AndriusCTR avatar AndriusCTR commented on July 22, 2024

you should update tmpChunkDir to work with windows filesystem too (if dev pc has windows):

instead of

mkdir($tmpChunkDir);

do

mkdir($tmpChunkDir, 0777, true);

Otherwise mkdir will throw errors about file missing, etc.

from resumable.php.

dilab avatar dilab commented on July 22, 2024

a PR is welcome.

from resumable.php.

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.