T
T
tigra2015-07-09 09:54:25
Yii
tigra, 2015-07-09 09:54:25

How to change paths to already uploaded photos?

In the position, I have photos loaded in a certain order. Now you can only delete the photo and upload it again. The order is important to me, so I added the "Edit" field to change the path to the photo. Select the same button as when loading, only to change. HELP WRITE ACTION. Does anyone have any examples?
4ebab91172e246839c667cd50ed9031c.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korovin, 2015-07-14
@vakorovin

Of course, you will excuse me, but there is a feeling that Google, like the search for the Toaster, is prohibited for you. Questions of this nature have been asked many times, including on this resource. Action, I think few people will undertake to write for you, after all, this is your job. The title of the question does not match the question itself. As far as it is clear from the question, you need to change not the path to the photo (how can you change the path to a specific file if it is in a specific place?), but the order of the uploaded photos. What prevents you from attaching some sorting jquery plugin to a form with photos of a specific material and updating an additional field in the photo table a la serail_id when saving? Examples? Not so long ago I wrote a similar answer, you can see in the answers, specifically the issue of implementation was discussed, although since that time we have switched to a slightly different algorithm - we wrote a file manager (right now we are combing the design), and already in the materials we only select the files uploaded through it. It turns out a table of images + a table of image bindings to materials (roughly speaking, with the following fields: post_id, img_id, serial_id). Consider the same architecture.
Actually the file manager itself:
Linking photos to the material (the button opens a modal window with the file manager and images are selected from there) - you can immediately move the image down with the mouse (the value of Image[serail_id] will automatically change):
c6a3e28a72a843dca3bbca1c695258b0.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question