upload with different link in db

upload with different link in db

GigilinEGigilinE Posts: 5Questions: 0Answers: 0

Hello, i used upload but when it put in db save link with server link, i want public link, how can do it?

Replies

  • GigilinEGigilinE Posts: 5Questions: 0Answers: 0
    edited October 2020

    i use this:

    Field::inst( 'img_link' )
    ->setFormatter( Format::ifEmpty( null ) )
    ->upload(
    Upload::inst( '/home/server/public_html/bot/new/image/SUPER/'.$time.'.'.'EXTN')
    ),

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    I don't quite understand the question I'm afraid. The instance you show there will be save the file to the file system, but no information about the file to the database.

    This example shows how you can also save information to the database, including the web path.

    More information about how the Upload class words, and how it can write information into the database is available here.

    Allan

This discussion has been closed.