Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dervis 17 posts 147 karma points
    Oct 15, 2018 @ 08:45
    Dervis
    0

    why the images dont show?

    When I run the web-application from Visual Studio 2017, the pictures are appear correctly.the path of image is like

    /media/1713/mypicture.png

    But after publishing the web-application, the pictures do not show.

    There are too many pictures in the media folder in the project and I need to call them from the database with umbraco. So the media folder is not included.

    Need i to set up my website for media urls?

  • Alex Sosa 17 posts 142 karma points
    Oct 15, 2018 @ 09:02
    Alex Sosa
    0

    Hi diojen,

    can you see the images on the media folder in your published app?

  • Dervis 17 posts 147 karma points
    Oct 15, 2018 @ 09:11
    Dervis
    0

    No i can't. Images not included. But it is working my local.

    This is my ftp and media file:

    enter image description here

    it have a web.config file and it is in writing this:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <handlers>
          <clear />
          <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
        </handlers>
      </system.webServer>
    </configuration> 
    
  • Alex Sosa 17 posts 142 karma points
    Oct 15, 2018 @ 09:18
    Alex Sosa
    100

    you need to include the images, on visual studio there is the option to show all files, click on it and you'll be able to see all files in the media folder, include all images, once that's done publish your app and check the media folder to make sure it is including the files, hopefully I'm making sense

    enter image description here

  • Dervis 17 posts 147 karma points
    Oct 15, 2018 @ 09:23
    Dervis
    0

    Thank you for your this solution but i think this is not true way beacuse there are a lot of images (i guess 500-600). I need a general solution for it.

  • Alex Sosa 17 posts 142 karma points
    Oct 15, 2018 @ 09:30
    Alex Sosa
    0

    what are you trying to achieve? somehow the files need to be added to the published app, otherwise even if the db is serving the correct url it wont be able to find the file, have you check on your browser dev tools to see why is it not displaying the images?

  • Dervis 17 posts 147 karma points
    Oct 15, 2018 @ 09:37
    Dervis
    0

    You are right. I can do what you say. I just wanted to know if there's another way to do that. I want to make sure it's the right way.

    If there is no other way, of course I will. And it will work as you say.

    I will write the results, thank you Alex

  • Alex Sosa 17 posts 142 karma points
    Oct 15, 2018 @ 09:39
    Alex Sosa
    0

    Hi diojen,

    no worries Kind regards Alex

  • Jamie Freeman 38 posts 151 karma points
    Oct 15, 2018 @ 10:38
    Jamie Freeman
    0

    Hi diojen,

    You can include the folder and all files recursively via editing the project file, in the same way Umbraco includes the CMS.

    Find the build folder within the Umbraco package (...\Umbraco\packages\UmbracoCms.7.12.2\build) and take a look at the props and target files. In the target file note

    <Target Name="AddUmbracoFilesToOutput">
        ...
    </Target>
    

    and the prop file is fairly standard, create a local copy and rename them concentrating on the AddUmbracoFilesToOutput within the prop file.

    if you look in your project file you can see

    ...
       <Error Condition="!Exists('..\packages\UmbracoCms.7.12.2\build\UmbracoCms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.12.2\build\UmbracoCms.props'))" />
       <Error Condition="!Exists('..\packages\UmbracoCms.7.12.2\build\UmbracoCms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\UmbracoCms.7.12.2\build\UmbracoCms.targets'))" />
    </Target>
    <Import Project="..\packages\UmbracoCms.7.12.2\build\UmbracoCms.targets" Condition="Exists('..\packages\UmbracoCms.7.12.2\build\UmbracoCms.targets')" />
    ...
    

    this is towards the bottom of the file.

    You can imitate this and test it and you can get the Media file to publish to output and any other extra files required.

    I can show you a working copy of this if you need (however it is on another PC so it will be later today)

    Jamie

  • Dervis 17 posts 147 karma points
    Oct 16, 2018 @ 10:29
    Dervis
    0

    Thank you jamie, this is a knowledge that will certainly benefit from my works, but I will solve my problem.

    And thank you Alex, you were right. My problem is solved.

Please Sign in or register to post replies

Write your reply to:

Draft