TEMA:

Problems with attachment names 1 año 2 meses antes #271397

  • Avatar de sciencemkt Autor del tema
  • sciencemkt
  • Fuera de línea
  • Navegador Experto
  • Navegador Experto
  • Registered
  • Science applied to marketing
  • Mensajes: 307
  • Gracias recibidas: 0
Hello:

I am making a form with the option to attach a PDF.

I need it to be saved in a folder in Dropbox and also on the server.

I am making the attachment successfully. But I need it with a specific name for each of the PDFs I upload.

The code I am using is:
if($this->formrow->name=='formname'){
$pdfname = 'doc-science.pdf';
}
else{
$recnr=$this->record_id ;
$pdfname = 'doc-science_' . $recnr . '.pdf';
}

I save it in: facileforms.process.php, around line 5381, replacing this line:
$pdfname = $this->uploads . '/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';

In Dropbox it attaches the PDF with the original name without spaces and also a PDF of the form with the configured name.

On the server it is saved in the folder I have assigned, but with the original name without spaces.

As a help I am doing everything according to the indications in this link:

crosstec.org/en/forums/3-breezingforms-f...iggered.html?start=0

How do I save the uploaded PDF with the assigned name, both in Dropbox and on the server?

Thanks for your help.
Alejandro Cobo
Neuromarketing Company

=============================================

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

Problems with attachment names 1 año 2 meses antes #271404

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi,

I assume this happend because by default .pdf is saved with ff_export...

But I suggest to use it like this:
if($this->formrow->name=='formname'){
$recnr=$this->record_id ;
$pdfname = 'doc-science_' . $recnr . '.pdf';
}
else{
 $pdfname = $ff_compath . '/exports/ffexport-pdf-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.pdf';
}
where formname is name of your form (not title).

If pdf is related to this specific form, then save it as doc-science_' . $recnr . '.pdf', otherwise keep the original name.

Also, here you can add the code for more then one form

Let me know the result

Regards,
Tihana

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

Problems with attachment names 1 año 2 meses antes #271464

  • Avatar de sciencemkt Autor del tema
  • sciencemkt
  • Fuera de línea
  • Navegador Experto
  • Navegador Experto
  • Registered
  • Science applied to marketing
  • Mensajes: 307
  • Gracias recibidas: 0
Hi Tihana:

I have not been able to get it to work. Now I get an error popup when submitting the form.

Can I send you the login details so you can please help me?

Thank you.

Este mensaje contiene información confidencial
Alejandro Cobo
Neuromarketing Company

=============================================

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

Problems with attachment names 1 año 2 meses antes #271466

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi,

which error do you see on submit, I tried to submit your form, but whetever pdf I tried to upload error message is here.

Could you please send me example for this file upload pdf?

Regards,
Tihana

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

Problems with attachment names 1 año 2 meses antes #271467

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi again,

please take a look to this topic:
crosstec.org/de/forums/1-forums/123249-p...ile-name.html#221984

This will solve problem :)

Just check line 5381

Hope this helps

Regards,
Tihana

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

Problems with attachment names 1 año 2 meses antes #271468

  • Avatar de sciencemkt Autor del tema
  • sciencemkt
  • Fuera de línea
  • Navegador Experto
  • Navegador Experto
  • Registered
  • Science applied to marketing
  • Mensajes: 307
  • Gracias recibidas: 0
Thank you Tihana for your dedication to this case:

This is the error I get when I submit the form. A popup that says: Attach a PDF.




PDFs should be saved in:

Este mensaje contiene información confidencial


This is the form:

Este mensaje contiene información confidencial


Thank you very much
Alejandro Cobo
Neuromarketing Company

=============================================

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

Tiempo de carga de la página: 0.067 segundos

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!