• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dropbox & Composer help
#1
Hi All,

I have just upgraded my Userspice to the latest version after being many version behind. I have got most of my site working but appear to be having an issue with on part. I currently have a process that uploads a file to Dropbox - this is based on the following guide / files https://github.com/kunalvarma05/dropbox-...load-Files.

For some reason with the update this script has stopped working and I can't figure out why. Can anyone help? The file gets created but does not upload and stops at the creation step. It worked perfectly in my previous version.

Looking through my code I have attached the point at which I think it stops if anyone can see anything obvious.

$file = "post/$filename.csv";

file_put_contents($file, $csv);
chmod($file, 0777);

require __DIR__ . '/vendor/autoload.php';
use Kunnu\Dropbox\Dropbox;
use Kunnu\Dropbox\DropboxApp;
use Kunnu\Dropbox\DropboxFile;
use Kunnu\Dropbox\Exceptions\DropboxClientException;

//Configure Dropbox Application
$app = new DropboxApp("XXXXXXXXXX", "XXXXXXXXX", "XXXXXXXXXXXXX");

//Configure Dropbox service

$pathToLocalFile = __DIR__ . "/post/$filename.csv";
$dropbox = new Dropbox($app);

$dropboxFile = new DropboxFile($pathToLocalFile);
$file = $dropbox->upload($dropboxFile, "/apps/clickanddrop/$filename.csv", ['autorename' => true]);

//Uploaded File
$file->getName();
?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<h1>Shipping File Upload</h1>
<!-- Content Goes Here. Class width can be adjusted -->
              <div class="alert alert-success">
  <strong>Success!</strong> <a href="https://business.parcel.royalmail.com/" target="blank" class="alert-link">Click Here To Print Labels</a>.
                <?php header( "refresh:30;url=$us_url_root./users" ); ?>
</div>
<!-- End of main content section -->
</div> <!-- /.col -->
</div> <!-- /.row -->
</div> <!-- /.container -->
</div> <!-- /.wrapper -->
  Reply
#2
Remove the refresh URL and try to find out if there are any errors. Do a dump on $file to see what is shown.

Brandin.
  Reply
#3
Hi Brandin,

Thanks for the quick response, I already tried to dump $file and it gives me the correct name. It doesn't get as far the as the refresh URL but I just removed it and tried to check and its the same.
  Reply
#4
I'm still trying to get this to work, i'm guessing it is something to do with composer as if I remove the composer parts of this script then everything else works and I can download the file.

I know that there was some big changes if anyone is good with composer the help would be great so I can figure out whats causing it to fail.
  Reply
#5
Unfortunately I'm terrible with composer. Have you tried removin the package and readding it? Also I would suggest checking the F12 Developer Tools Menu to watch the Network as you hit the page and it completes the upload (unless the server does this on the clients behalf...?)
  Reply
#6
Thanks I have tried re-adding it but i'm not getting any joy Sad
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)