Bienvenido, Invitado
Recordarme

TEMA:

Saving to DropBox Folder 6 años 11 meses antes #151360

  • Autor del tema
  • azhpo
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 16
  • Gracias recibidas: 0
Hi, I have everything set to work with Dropbox. It all works fine, all the forms submits (in this case pdf and attachments) are stored in a Dropbox folder.
But, eveything is stored in the same folder (eg. dropbox/submits). What I wanted is to automatically create an individual folder for every submit, because more than 1 file is stored for each user that submits a form (eg. dropbox/submits/user1, dropbox/submits/user2, and so on).

I hope I was clear explaining my issue. So instead of all files being stored in a single folder, I wanted a folder to every single user that sends a form submit.

Is this possible? With dropbox or any other file storage system?

Best regards.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by azhpo.

Saving to DropBox Folder 6 años 11 meses antes #151365

  • Avatar de pedro81
  • pedro81
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 15273
  • Karma: 287
  • Gracias recibidas: 1077
Hello,

it should work changing the file:
\components\com_breezingforms\facileforms.process.php

around the code line 7645:
$dbxClient->uploadFile('/'.($this->formrow->dropbox_folder != '' ? $this->formrow->dropbox_folder : $this->formrow->name) . '/' . basename($dropbox_file), call_user_func($space.'::add'), $f);

change it to:
$dbxClient->uploadFile('/'.($this->formrow->dropbox_folder != '' ? $this->formrow->dropbox_folder : JFactory::getUser()->get('name') == '' ? '_unknown_user_' : JFactory::getUser()->get('name')) . '/' . basename($dropbox_file), call_user_func($space.'::add'), $f);

this creates a new folder with the current user name.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Saving to DropBox Folder 11 meses 3 semanas antes #261335

  • Avatar de famouswebsites
  • famouswebsites
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 33
  • Gracias recibidas: 1
This is the sort of solution I need but I think BF has been updated since this post, does anyone have a step guide for enabling Dropbox folders per username with a later BF version?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Saving to DropBox Folder 11 meses 3 semanas antes #261336

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10535
  • Karma: 3
  • Gracias recibidas: 705
Hi,

yes, bf is updated in the meantime.

Please go to this path:
\components\com_breezingforms\facileforms.process.php
then in line 7807 you will see:
											'/'.($this->formrow->dropbox_folder != '' ? $this->formrow->dropbox_folder : $this->formrow->name) . '/' . basename($serverPath),
change it to this:
/'.($this->formrow->dropbox_folder != '' ? $this->formrow->dropbox_folder : JFactory::getUser()->get('name') == '' ? '_unknown_user_' : JFactory::getUser()->get('name')) . '/' . basename($serverPath), 

Let me know the result

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by tihana.krivic.

Saving to DropBox Folder 11 meses 1 semana antes #261698

  • Avatar de famouswebsites
  • famouswebsites
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 33
  • Gracias recibidas: 1
Hi Tihana,

First try copying your code didn't work but it put me in the right direction. I tried a couple of things and ended up with this:

//====----
$thisuser = JFactory::getUser();
'/'.($this->formrow->dropbox_folder != '' ? $this->formrow->dropbox_folder : JFactory::getUser()->get('name') == '' ? $thisuser->username : JFactory::getUser()->get('name')) . '/' . basename($serverPath), $file_to_upload
//====----

... which works perfectly.
A BIG thank you for your help ;)

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Saving to DropBox Folder 11 meses 1 semana antes #261701

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10535
  • Karma: 3
  • Gracias recibidas: 705
Hi,

super!

Np, anytime :)

If you need more help, feel free to ask

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Moderadores: ForumSupport
Tiempo de carga de la página: 0.055 segundos