1

I am trying to implement Resumable.js with a PHP backend, and am using the sample backend provided: Sample Backend

I make the call from my javascript page via:

var r = new Resumable({
        target:'backend.php',
        chunkSize:1*1024*1024,
        simultaneousUploads:4,
        testChunks:false,
        throttleProgressCallbacks:1
      });

However, it seems to log this error when it reaches this line in the PHP file

if (!@move_uploaded_file($file['tmp_name'], $dest_file)) {
    _log('Error saving (move_uploaded_file) chunk '.$_POST['resumableChunkNumber'].' for file '.$_POST['resumableFilename'].'tmp_name: '.$file['tmp_name']);

This is the log

16.01.2013: Error saving (move_uploaded_file) chunk 1 for file Invoice-2010-04-30.xls tmp_name/tmp/phpqggZ0O

Is there a specific reason why? The PHP I'm using is the exact one taken from the link above.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Fasih Awan
  • 1,891
  • 4
  • 17
  • 24
  • 1
    Is `$dest_file` a valid file? Is it in a writable directory? If you don't suppress the error, you might have a better idea of what is going on. – Waleed Khan Jan 16 '13 at 17:59
  • Okay so it seems that `$file['tmp_name']` gives me a directory I can't write to. Where could I change the storage directory? Would it be in the PHP or the Javascript? – Fasih Awan Jan 16 '13 at 18:22
  • Suppressing error does nothing, only a tmp folder is made. The folder I am writing to has `apache` write permissions, would that be a problem? This would be my first time doing all of this – Fasih Awan Jan 16 '13 at 18:47

1 Answers1

2

I fixed this issue by modifying the directories that the PHP file uses. A lot of times it would use incorrect, or just out of place directories. Once that was fixed, it was working fine.

Fasih Awan
  • 1,891
  • 4
  • 17
  • 24
  • Also had errors, only I didn't get any logs. Changed the upload dir and magically everything started to work again! Thanks a lot ! – Lonefish Mar 23 '16 at 16:04