Jump to content

File upload API


AutID
 Share

Recommended Posts

Hello,

Does anyone knows any file upload UDFs or API??? I am searching for a file upload api without requireing an account.

Not large files. Just some small txt files arround 50-100 kb...

I found some UDF on examples forum but they all require account.

Any kind of help is appreciated.

Cheers

Edit: Btw because i found a lot of posts with IE automation, of course it is not what i am looking for.

Edited by AutID
Link to comment
Share on other sites

If they are only 50 - 100k text files, you could try pastebin, Check out my signature. Just set the publicity to private.

#include <File.au3>
#include <Pastebin.au3>

;~ Directory with text files in ~;
$vDir = "C:\textfiles"

;~ Read File List to Array ~;
$vFileArr = _FileListToArray($vDir)

;~ Open Pastebin WinHTTP ~;
_PB_Open()

;~ Loop Through Files and Post Them To Pastebin ~;
For $i = 1 to $vFileArr[0]
    $vFileRead = FileRead($vDir & "\" & $vFileArr[$i])
    $vPaste = _CreatePaste($vFileRead, $vFileArr[$i], "text", 0)
    ConsoleWrite($vFileArr[$i] & " - " & $vPaste & @CRLF)
Next

;~ Close Pastebin WinHTTP ~;
_PB_Close()
Edited by mrflibblehat

[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Link to comment
Share on other sites

You could also look at using ge.tt's API, pretty simple to implement using the WinHTTP UDF.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

traslate this snippet. it's very easy. It's coded in vb6.

 

' =================================================================
' =================================================================
' => Autor: Danyfirex
' => Upload file to AnonFiles.com
' => Gracias AnonFiles.com
' => Fecha : 14|05|2013
' => Uso: AnonFilesUpload("c:hola.rar")
' => Retorno: Texto de Respuesta (hotlink)
' =================================================================
' =================================================================


Option Explicit

Function AnonFilesUpload(filepath As String) As String
Dim boundary As String
Dim Post As String
Dim bytesfinal()  As Byte
Dim bytes() As Byte
Dim url As String
Dim Http As Object
Dim filedata As String

url = "https://anonfiles.com/api/hotlink"
boundary = "--------Boundary"


Open filepath For Binary As #1
ReDim bytes(LOF(1) - 1)
Get #1, , bytes()
Close #1
filedata = StrConv(bytes(), vbUnicode)

Post = "--" & boundary & vbCrLf & _
"Content-Disposition: form-data; name=" & Chr(34) & "file" & Chr(34) & "; filename=" & Chr(34) & filename(filepath) & Chr(34) & vbCrLf & _
"Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _
filedata & vbCrLf & _
"--" & boundary & "--" & vbCrLf

bytesfinal() = StrConv(Post, vbFromUnicode)

Set Http = CreateObject("winhttp.winhttprequest.5.1")
Http.Open "POST", url, False
Http.SetRequestHeader "Content-Type", "multipart/form-data; " & "boundary=" & boundary
Http.Send (bytesfinal())
AnonFilesUpload = Http.ResponseText
Set Http = Nothing
End Function

Function filename(cadena As String) As String
Dim cadenas() As String
cadenas() = Split(cadena, "")
filename = cadenas(UBound(cadenas))
End Function

Link to comment
Share on other sites

Oh that's a new site I haven't heard of. Probably best to post that in a code box if I were you.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

If they are only 50 - 100k text files, you could try pastebin, Check out my signature. Just set the publicity to private.

 I will take a look

Edit: i took ur function :D

 

You could also look at using ge.tt's API, pretty simple to implement using the WinHTTP UDF.

I used to know that site but i had forgot about it :D

The only problem is that looking at the Rest api of the ge.tt it requires an account to be able to use the api. From what i am understanding

 

 

traslate this snippet. it's very easy. It's coded in vb6.

 

 

' =================================================================

' =================================================================

' => Autor: Danyfirex

' => Upload file to AnonFiles.com

' => Gracias AnonFiles.com

' => Fecha : 14|05|2013

' => Uso: AnonFilesUpload("c:hola.rar")

' => Retorno: Texto de Respuesta (hotlink)

' =================================================================

' =================================================================

Option Explicit

Function AnonFilesUpload(filepath As String) As String

Dim boundary As String

Dim Post As String

Dim bytesfinal()  As Byte

Dim bytes() As Byte

Dim url As String

Dim Http As Object

Dim filedata As String

url = "https://anonfiles.com/api/hotlink"

boundary = "--------Boundary"

Open filepath For Binary As #1

ReDim bytes(LOF(1) - 1)

Get #1, , bytes()

Close #1

filedata = StrConv(bytes(), vbUnicode)

Post = "--" & boundary & vbCrLf & _

"Content-Disposition: form-data; name=" & Chr(34) & "file" & Chr(34) & "; filename=" & Chr(34) & filename(filepath) & Chr(34) & vbCrLf & _

"Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _

filedata & vbCrLf & _

"--" & boundary & "--" & vbCrLf

bytesfinal() = StrConv(Post, vbFromUnicode)

Set Http = CreateObject("winhttp.winhttprequest.5.1")

Http.Open "POST", url, False

Http.SetRequestHeader "Content-Type", "multipart/form-data; " & "boundary=" & boundary

Http.Send (bytesfinal())

AnonFilesUpload = Http.ResponseText

Set Http = Nothing

End Function

Function filename(cadena As String) As String

Dim cadenas() As String

cadenas() = Split(cadena, "")

filename = cadenas(UBound(cadenas))

End Function

I will give that a go

Edit: that site is dead. Or it doesnt work properly. It doesnt give me an url from files uploaded

Edited by AutID
Link to comment
Share on other sites

For me is working  correctly. try again.

saludos

edit:

Look the ported example:

Func AnonFilesUpload($Filepath)

Local $sServerURL="https://anonfiles.com/api/hotlink"
Local $boundary = "--------Boundary"

Local $Postdata = "--" & $boundary & @crlf & _
"Content-Disposition: form-data; name=" & Chr(34) & "file" & Chr(34) & "; filename=" & Chr(34) & filename($filepath) & Chr(34) & @crlf & _
"Content-Type: application/octet-stream" & @crlf & @crlf & _
Fileread("1.txt") & @crlf & _
"--" & $boundary & "--" & @crlf



Local $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
$oHTTP.Open("POST", $sServerURL, false)
$oHTTP.SetRequestHeader("Content-Type", "multipart/form-data; " & "boundary=" & $boundary)
$oHTTP.Send($Postdata)
$oHTTP.WaitForResponse()
$hotlink=$oHTTP.ResponseText
$hotlink=StringRegExpReplace(stringmid($hotlink,StringInStr($hotlink,"https")),'[/"}]',"")
Return $hotlink

EndFunc


Func filename($filepath)
Local $file=StringSplit($filepath,"\")
Return $file[(ubound($file)-1)]
EndFunc

saludos

Edited by Danyfirex
Link to comment
Share on other sites

It doesn't work. Check your consolewrite output. It will always return the same link no matter what. That site is dead in my opinion. Or turned into an adds site.

Local $filepath = @DesktopDir & "\chat.txt"
$output = AnonFilesUpload($filepath)
ConsoleWrite(filename($filepath) & @CRLF)
ConsoleWrite($output & @CRLF)

Func AnonFilesUpload($filepath)

Local $sServerURL = "https://anonfiles.com/api/hotlink"
Local $boundary = "--------Boundary"

Local $Postdata = "--" & $boundary & @CRLF & _
"Content-Disposition: form-data; name=" & '"' & "file" & '"' & "; filename=" & '"' & filename($filepath) & '"' & @CRLF & _
"Content-Type: application/octet-stream" & @CRLF & @CRLF & _
FileRead($filepath) & @CRLF & _
"--" & $boundary & "--" & @CRLF



Local $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
$oHTTP.Open("POST", $sServerURL, False)
$oHTTP.SetRequestHeader("Content-Type", "multipart/form-data; " & "boundary=" & $boundary)
$oHTTP.Send($Postdata)
$oHTTP.WaitForResponse()
$hotlink = $oHTTP.ResponseText
$hotlink = StringRegExpReplace(StringMid($hotlink, StringInStr($hotlink, "https")), '[/"}]', "")
Return $hotlink
EndFunc


Func filename($filepath)
Local $file = StringSplit($filepath, "\")
Return $file[(UBound($file) - 1)]
EndFunc
Link to comment
Share on other sites

You're uploading the same file. use a diferent file. Not same MD5 or hash.

 

saludos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...