Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Question about get_full_upload_url function #14

Open
mittus opened this issue Oct 4, 2018 · 4 comments
Open

Question about get_full_upload_url function #14

mittus opened this issue Oct 4, 2018 · 4 comments
Milestone

Comments

@mittus
Copy link

mittus commented Oct 4, 2018

Hello!!

I was problem with image url's in file upload fields.

I need get absolute image urls without domain name. For that I added new input after Title input:
screenshot_20

But I seen bad urls:
screenshot_21

Then I loock to the function in the UploadHandler.php and see that:
screenshot_19

When I use this short url, all functions on fileupload field work's correct:
screenshot_22
Then I got truthful urls:
screenshot_23

I use short abs. urls anywhere, because I am working with git and has a problems with urls in local/production projects.
screenshot_24

Is it possible to take this into the plugin?

@bigin
Copy link
Owner

bigin commented Oct 4, 2018

I can't remember why I did this. Did you tested it on install in a subdirectory, does it work?

@bigin
Copy link
Owner

bigin commented Oct 4, 2018

If I remember correctly, the full URL is generated on runtime, is not static, and isn't stored anywhere. It's only used when displaying images via the file upload field, and does not depend on your environment.

@mittus
Copy link
Author

mittus commented Oct 4, 2018

I can't remember why I did this. Did you tested it on install in a subdirectory, does it work?

Yes, with subdirectory my variant dosen't work. But I fix that with global variable $SITEURL, and now it work with all sites:
screenshot_25

If I remember correctly, the full URL is generated on runtime, is not static, and isn't stored anywhere. It's only used when displaying images via the file upload field, and does not depend on your environment.

Yes, its true. But I will need get this url to the "input" on my project. I would copy this url, and pasting it, when it needed, into the wysiwyg redactor:
screenshot_26

@bigin
Copy link
Owner

bigin commented Oct 4, 2018

Unfortunately, I have no way to test your efforts, but I will try to take the time next week to do that.

If you want, you can use this construct temporarily:

return IM_SITE_URL.'data/uploads/imanager/';
  • because we have already defined $SITEURL as a constant IM_SITE_URL in _def.php, so we don't have to change it in different places.

Thank you for your effort!

@bigin bigin added this to the 2.4.6 milestone Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants