Find Jobs
Hire Freelancers

Save FileStream Function and Convert FileStream To String

$30-100 USD

Em Andamento
Publicado há aproximadamente 14 anos

$30-100 USD

Pago na entrega
On deliverables; I have the source code for the project that was started. What I need are 2 routines completed. The first function is called SaveFile. What needs to save to the path specified the Stream. Another routine is a function called ConvertStreamToString. The purpose of this one is I have processes sometimes where I have the stream but it needs to be converted to a String to run functions on it. The sample uses the path C:\[login to view URL] Whatever file extension that is used when recreating the sample needs to be used for the paths for saving (to prove it works). (for example if using .gif; then instead of C:\[login to view URL]; will be C:\[login to view URL] plus C:\[login to view URL] instead of C:\[login to view URL] and C:\[login to view URL] instead of C:\[login to view URL]). If everything is fine; then when running the code; the 3 new files should be exactly the same as the source file. The purpose of the sample instead of just using FileCopy is the data is being uploaded to a server. Both approaches are needed (String representing file and FileStream). ## Deliverables The code I have is here. I have to post it here. Because I am using visual studio 2010 RC edition and I assume that whatever works should be fine for Visual Studio 2008. Module Module1 Sub Main() Dim OldPath As String OldPath = "C:\[login to view URL]" Dim FileString As String = "" Dim FileStream As [login to view URL] Dim ResultsString As String = "" FileString = GetFileString(OldPath) SaveFile("C:\[login to view URL]", FileString) FileStream = GetFileStream(OldPath) SaveFile("C:\[login to view URL]", FileStream) ResultsString = ConvertStreamToString(FileStream) SaveFile("C:\[login to view URL]", ResultsString) End Sub Private Function FixBase64ForImage(ByVal str_Image As String) As String '*** Need to clean up the text in case it got corrupted travelling in an XML file Dim sbText As New [login to view URL](str_Image, [login to view URL]) [login to view URL]("\r\n", [login to view URL]) [login to view URL](" ", [login to view URL]) Return [login to view URL]() End Function Private Function GetFileString(ByVal Path As String) As String Dim byte_Array() As Byte byte_Array = [login to view URL](Path) Return [login to view URL](byte_Array) End Function Private Function GetFileStream(ByVal Path As String) As [login to view URL] Return New [login to view URL](Path, [login to view URL]) End Function Private Function ConvertStreamToString(ByVal Stream As [login to view URL]) As String 'needs to be able to convert the stream to a string (because there are processes where it needs to be a string to work with End Function Private Sub SaveFile(ByVal Path As String, ByVal Stream As [login to view URL]) 'needs to be able to save the stream to the given path End Sub Private Sub SaveFile(ByVal Path As String, ByVal Data As String) If [login to view URL](Path) = True Then [login to view URL](Path) End If Dim byte_Array() As Byte byte_Array = [login to view URL](FixBase64ForImage(Data)) [login to view URL](Path, byte_Array, False) End Sub End Module Needs the source code only. Must work on buyers environment. ## Platform Windows (all versions).
ID do Projeto: 3353523

Sobre o projeto

3 propostas
Projeto remoto
Ativo há 14 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$17 USD em 1 dia
5,0 (66 avaliações)
4,5
4,5
3 freelancers estão ofertando em média $34 USD for esse trabalho
Avatar do Usuário
See private message.
$42,50 USD em 1 dia
4,7 (6 avaliações)
3,3
3,3
Avatar do Usuário
See private message.
$42,50 USD em 1 dia
5,0 (5 avaliações)
2,3
2,3

Sobre o cliente

Bandeira do(a) AUSTRALIA
Sydney, Australia
5,0
781
Método de pagamento verificado
Membro desde abr. 9, 2002

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.