source links foe images change after a certian amount of time?

Navržená odpověď source links foe images change after a certian amount of time?

  • sabato 3 dicembre 2011 23:42
     
     

    Hi

     

    I use live connect sdk to download images to my app on windows phone i then save the source links to isolated storage how ever it seems that after  a certian peorid of time the source links are no longer valid even if the apps session is still logged in.. is this the normal?? do i need to always need to get new source uri for the pictures?

     

    thank you 

Tutte le risposte

  • domenica 4 dicembre 2011 23:48
     
     Risposta suggerita

    You're correct. The "source" and "picture" fields from SkyDrive images (and all other SkyDrive items for that matter) are not meant to be stored. They do expire after an amount of time on the order of an hour or more. This is a user protection measure.

    If you wanted to access the images later, I would suggest storing the photo's "id" field. The ID will not change as long as the photo remains where it is. Then to download to photo you will need to make sure you have a valid access token and you can either to a GET on the ID as you are doing now, or you can perform a GET on the path .../PHOTO_ID/content which will 302 redirect you to the photo content or return a 404 if the photo no longer exists.

    Another alternative is the .../PHOTO_ID/picture path which takes the "type" query parameter and accepts the values "full", "normal", "album" and "small".

    Hope this helps.

  • martedì 6 dicembre 2011 16:11
     
     

    Hi Matt

     

    Thank you for that info I do have one more question that is I noticed that images "source" usally starts with http://storage.live.com/ in which i can call the direct url from within my app to open it using new uri(source, urikind.absolute) however other file types I seem to get a source of https://jk9mla.bay.livefilestore.com/ and seem  to not be able to just call the url from within my app using new uri(source, urikind.absolute) this is all while i have a current access token the session is live. is there something else extra i need to do or how would i be able to request from the https://jk9mla.bay.livefilestore.com/ from within my app to be able to open other files types??

  • martedì 6 dicembre 2011 16:23
     
     

    Hi Matt

     

    Thank you for that info I do have one more question that is I noticed that images "source" usally starts with http://storage.live.com/ in which i can call the direct url from within my app to open it using new uri(source, urikind.absolute) however other file types I seem to get a source of https://jk9mla.bay.livefilestore.com/ and seem  to not be able to just call the url from within my app using new uri(source, urikind.absolute) this is all while i have a current access token the session is live. is there something else extra i need to do or how would i be able to request from the https://jk9mla.bay.livefilestore.com/ from within my app to be able to open other files types??

    Do you have more details on the problems you are having? Is it simply the usage of HTTP vs. HTTPS or is it specific to the file type? 
  • martedì 6 dicembre 2011 18:36
     
     

    Hi Dare


    I think its more related to the http vs https.

     

    I am testing using a simple webclient client = new webclient

    and passing the uri using new uri(http uri ) or the (https uri)


    I am not sure if you could tell me what the broswer does when it opens a file by going to live.com signing in and then going to the file opening it there.. as after i do this once i can then open the https files via my app from this point going forward.
    • Modificato rruffman07 martedì 6 dicembre 2011 18:59
    •  
  • mercoledì 7 dicembre 2011 00:45
     
     

    That's really interesting, there shouldn't be anything special you have to do to use the source URLs. If I'm understanding this properly, what you're telling us, is that if you upload a non-photo through the Live Connect APIs, and then try to retrieve that file and download it, that the download fails? But then if you attempt to download the file via skydrive.live.com the source members start working?

    What happens when a source URL "doesn't work"? What types of errors do you see? Are these only files on your root SkyDrive folder or are they files in sub-folders as well?

    The more information I get here, the easier it'll be for me to locate any issues.

    Thanks!

  • mercoledì 7 dicembre 2011 04:59
     
     

    Hi Matt

    just to cerify I can download anytype of file via liveconnect downloadclient and pass the "folderid" no problem at anytime without any problems but this delays the user as i have to wait til its completely downloaded.

    but what i was speaking of is when i use the source link directly to just be able to pass that using new uri("source") method and pass that to my source only pictures work and they seem to have an http address not https but any other files have an https address and source links will not work at first however if I exit my app then go to i.e. / phone broswer from the same phone and login to the skydrive account go to the folder that contains the files tap on one of the files then tap download once it opens i can exit i.e. then go back into my app and at that point the source links will work and continue to work unless i then go back to the broswer and signout from the broswer then they will not work again the files are not on the root there are within a sub folders i created. also the folders were created via signing in to skydrive on a desktop pc not my app.. as far as the url when its not working its hard to tell whats going on as i do not get any errors other than like if i try to attach to a memorystream and access the stream it will say the stream is null; but if its attached to a source it will give an error...

     

    thank you

    Juan


    • Modificato rruffman07 mercoledì 7 dicembre 2011 05:03
    •