Copied to clipboard

Flag this post as spam?

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


  • Duc Tran 10 posts 30 karma points
    Dec 14, 2010 @ 02:50
    Duc Tran
    0

    Get image width of upload field

    Hi,

    I have a page with child items where there is a field called "image" using the type Upload.

    I am aware you can get the image witdh using getMedia, but I don't think this is relevant here.

    Can anyone advise on how I can get the image width of the image file uploaded using this method?

    Thanks

    dt

  • Sascha Wolter 615 posts 1101 karma points
    Dec 14, 2010 @ 03:12
    Sascha Wolter
    0

    Hi dt,

    AFAIK in case of image media items these values get automatically set upon uploading an image, which means that they are only retrieved once when the file is uploaded and not on the fly when you access the edit page for that item. In either case you would have to write the logic for retrieving these values yourself (which isn't too big a problem with .Net but might be quite tricky to hook up with Umbraco depending on what you acutally need this for). Then you've got the option of storing the values once or retrieving them on the fly whenever somebody views that page in the backend.

    Partly because of these circumstances I've never used an Upload control directly on a page but have always linked to a media item, although there might have been a slighly more user-friendly way of doing it in each case (nothing against the media library, it's great!).

    If you can let us know what you actually need the information for there might be another way.

    Cheers,

    Sascha

  • Duc Tran 10 posts 30 karma points
    Dec 14, 2010 @ 05:32
    Duc Tran
    0

    Hi,

    I figured that. It is too late now, I'll write a .net script to do it.

    If the Media picker allowed you to upload a document at that step, it would make it more usable.

    Thanks,

    dt

Please Sign in or register to post replies

Write your reply to:

Draft