|
-
January 17th, 2008, 09:22 PM
#1
Saving a picture from a web site
I tried to move the file from the Temporary Internet Files folder but access is restricted.
Code:
My.Computer.FileSystem.CopyFile(TempPath & filename, StartPath & "\Saved")
picture boxes are are also restricted from the TIF directory.
I am able to get the URL of the picture but still havent had success in saving the image.
Does anyone know how to go about doing this?
-
January 17th, 2008, 09:52 PM
#2
Re: Saving a picture from a web site
 Originally Posted by Reveille
I tried to move the file from the Temporary Internet Files folder but access is restricted.
Code:
My.Computer.FileSystem.CopyFile(TempPath & filename, StartPath & "\Saved")
picture boxes are are also restricted from the TIF directory.
I am able to get the URL of the picture but still havent had success in saving the image.
Does anyone know how to go about doing this?
Check may be file is read only.
Ritik D Dodhiwala
Software Devloper
Mumbai,India
[IF MY SUGGESTIONS WORKS POSITIVLY PLEASE RATE POSITIVLY ]
-
January 17th, 2008, 09:56 PM
#3
Re: Saving a picture from a web site
More likely it's still loaded in the browser. Close all browser windows.
-
January 17th, 2008, 10:05 PM
#4
Re: Saving a picture from a web site
If you have the URL, just get your own copy with the URLDownloadToFile API.
Code:
Private Declare Function URLDownloadToFile Lib "urlmon.dll" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub TryThis()
Dim sURL As String, sTarget As String
sURL = "http://somewebsite.com/somepicture.jpg"
sTarget = "C:\SomeFolder\somepicture.jpg"
Call URLDownloadToFile(0, sURL, sTarget, 0, 0)
End Sub
-
January 17th, 2008, 10:51 PM
#5
Re: Saving a picture from a web site
Comintern, you are my saviour.
I had to change the parameters from Long to Integer because it was "destabilizing the stack" o.O but other than that it worked like a charm.
THANK YOU!
-
January 17th, 2008, 11:34 PM
#6
Re: Saving a picture from a web site
Ahhhh... Didn't notice you were using .NET. Glad it worked for you.
-
January 18th, 2008, 11:35 AM
#7
Re: Saving a picture from a web site
 Originally Posted by Comintern
Ahhhh... Didn't notice you were using .NET. Glad it worked for you.
Then this post is in the wrong forum....
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|