Copied to clipboard

Flag this post as spam?

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


  • Richard 38 posts 78 karma points
    Feb 17, 2010 @ 11:08
    Richard
    0

    Open external window using templated page?

    Hi, after so much luck with my last request, I thought I'd ask for another tip. This must be possible with Umbraco 4.0.3. I am experienced with ASP.NET 3.5/Ajax and have a couple of days experience with Umbraco, so the answer can be terse.

    I need to have a user input an image file name  in a page (got that using CWS_Photo variant :-) and then use the  full path of this stored gallery photo to construct a page which then opens in a separate browser window. This would be simple using standard ASPX and pulling the name and path of the photo from a DB or wherever and construct the page (I do not want it to appear in the query string unless it is encrypted). So how to I get at this path in Umbraco, and how to I construct and start a complete ASPX or HTML page. If I have a URL, then I can simply use  js window.open(url...), but the URL must point the the constructed page... I feel like all the pieces are there, but I can't get at the path and only see how to build ascx, not aspx.OK, the templates are x.master, so could I just create a x.cs.master by hand...?

    Any ideas how to get this done without exposing the path to the media object in a query string?

    Thanks!

    Richard

  • Seth Niemuth 275 posts 397 karma points
    Feb 17, 2010 @ 11:17
    Seth Niemuth
    0

    You could simply pass the ID of the media object in the query string? and then use the GetMedia function in the umbraco library (http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/GetMedia)

  • Richard 38 posts 78 karma points
    Feb 17, 2010 @ 11:27
    Richard
    0

    Looks good. Where do I get the ID of the media object? The properties defined in the Photo document type are photoText and photo (Upload).

    Thanks!

    R

  • dandrayne 1138 posts 2262 karma points
    Feb 17, 2010 @ 12:10
    dandrayne
    0

    To easily get the ID of a media item, it may be wise to store it in the media library and use a mediaPicker.  As far as I remember, an upload field just stores the path to the file.  Could be wrong though, it's been a while since I used it!

    Dan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 17, 2010 @ 15:31
    Jan Skovgaard
    0

    Yes the upload field just stores the path to the file so the media picker is the way to go.

    /Jan

  • Richard 38 posts 78 karma points
    Feb 17, 2010 @ 16:16
    Richard
    0

    Hmm, I'm new to this and I read all over the place about "pickers" but I'm not even sure what is special about them and how they work. Two things: 1. the user is uploading a file from somewhere. I already use a file broswer to find the "upload path", what is a media picker in this context? 2. Any examples around?

    Thanks!

    R

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 17, 2010 @ 16:28
    Jan Skovgaard
    0

    If you're going to use the Media Picker approach you need to upload your images etc. to the media library in Umbraco.

    When you have done that  you can choose it from the content section on a document type where you have placed the media picker property.

    When you then pick an image from the media library the media picker holds the id value that you need to accomplish your task.

    I hope this helps.

    /Jan

  • dandrayne 1138 posts 2262 karma points
    Feb 17, 2010 @ 17:48
  • Richard 38 posts 78 karma points
    Feb 17, 2010 @ 18:00
    Richard
    0

    Thanks! Well, the media picker souns almost like a workaround here, but I need to learn it anyway... so, I began by trying to upload a 6 MB mpeg4 file using the same upload control that works fine for images. Firefox V3.6 crashed (many times). Do I need to use another uploader? I think I may go for the query string after all :-)

    Richard

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 17, 2010 @ 18:22
    Dirk De Grave
    0

    Richard,

    uploading 6mb mpeg4 won't be supported by default, as your web.config is probably configured to only allow uploads up to 2mb's (can be machine.config as well if not defined in web.config). You can however raise the bar and set it to allow uploads of 10mb, or whatever size you like (there's a max which I don't know by heart...). Check this as a reference on how to allow larger uploads.

     

    Hope this helps.

    Regards,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft