Member_2_6479049
asked on
How to save a picture box in a specific network folder using vb.net 2013
I'm trying to save the picture box to a folder in a network, this code works fine but the pic is save in MyComputer but I need to save it a this path \\Extlansbs09\Scrh_Fotos
The
Can you guys help me please!
The
Dim ImageDialogue As OpenFileDialog = New OpenFileDialog()
Dim cFileName As String = cgClavePersona
ImageDialogue.Title = "Seleccione la foto"
ImageDialogue.InitialDirectory = "\\Extlansbs09\Scrh_Fotos\"
ImageDialogue.Filter = "Image Files|*.gif;*.jpg;*.png;*.bmp;"
ImageDialogue.RestoreDirectory = False
If ImageDialogue.ShowDialog() = DialogResult.OK Then
FotoTit.Image = Image.FromFile(ImageDialogue.FileName)
End If
If Me.FotoTit.Image IsNot Nothing Then
Me.FotoTit.Image.Save(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyPictures, cFileName & ".jpg"))
End If
Can you guys help me please!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Q1. What kind of class is the Image instance (FotoTit.Image)?
Q2. If it is your own code can you post the code?
IF it is a third party there is nothing you can do about it, unless you consider save a temp file locally and then copy that file to the network location.
Q2. If it is your own code can you post the code?
IF it is a third party there is nothing you can do about it, unless you consider save a temp file locally and then copy that file to the network location.
ASKER
Good morning Miguel,
The images i'm using are 'jpg' and the code is this
The images i'm using are 'jpg' and the code is this
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim ImageDialogue As OpenFileDialog = New OpenFileDialog()
Dim cNombreArchivo As String = cgClavePersona
ImageDialogue.Title = "Seleccione la foto"
ImageDialogue.InitialDirectory = "\\Extlansbs09\Scrh_Fotos\"
ImageDialogue.Filter = "Image Files|*.gif;*.jpg;*.png;*.bmp;"
ImageDialogue.RestoreDirectory = False
If ImageDialogue.ShowDialog() = DialogResult.OK Then
FotoTit.Image = Image.FromFile(ImageDialogue.FileName)
End If
If Me.FotoTit.Image IsNot Nothing Then
Me.FotoTit.Image.Save(IO.Path.Combine("\\Extlansbs09\Scrh_Fotos\", cNombreArchivo & ".jpg"))
End If
End Sub
ASKER
Alex,
It was solved, there was an error in our dns server and once is fixed, the pic was saved!!!
Thank you so much Alex.
It was solved, there was an error in our dns server and once is fixed, the pic was saved!!!
Thank you so much Alex.
ASKER
Excelent help!!!
Thank you so much.
Thank you so much.
No worries, I had my fair share of DNS issues myself. Cheers M
ASKER
I'm having this error:
An unhandled exception of type 'System.Runtime.InteropSer
Additional information: A generic error occurred in GDI+.