⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

save file path in database



rafanl22

rafanl22
  • profile picture
  • Member

Posted 04 April 2016 - 21:45 PM

Good day I am new at this, my question is can save file path in database after upload a file with file_upload?
 
Thank you

 


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 03 May 2016 - 15:54 PM

What mean file path? When u upload file and then save it - u save just filename like string in DB, Crud do this for u by default


rafanl22

rafanl22
  • profile picture
  • Member

Posted 11 May 2016 - 16:35 PM

for example in the field of BD appears

 

 assets/uploads/files/imagenes/ejemplo.png

 

Tks


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 12 May 2016 - 05:48 AM

Hi rafanl22

 

What GC library dose is - it just saves the image name by default - not the image name with the path. There is a simple reason to the same - it picks up the image path based on the configuration ...

What you can do is create additional field for actual image path - add the field - keep it hidden. 

add callback_after_insert / update ...

reset the value of the actual image path with the path set for upload and the file name (in the upload field)....

this way u will be able to get your actual image path available ... as required.


rafanl22

rafanl22
  • profile picture
  • Member

Posted 12 May 2016 - 18:48 PM

Ok thank you for your help