blitzget issues..

BlitzPlus Forums/BlitzPlus Programming/blitzget issues..

I have this weird bug with BlitzGet when i use it to download a file even if I change the file it downloads the unchanged file, for example if I have a file called Xnumber.txt and it has a 2 inside the file and I replace it with a file of the same name but put 3 instead of 2 it will download the file with a 2 until I clear my internet cache. Anyone have any ideas on how to fix this?

for some reason its using cached files instead of getting the new files.

Maybe you could delete the cached file in code ? What folder are the downloads in ? Is that the same folder as SystemProperty$("tempdir") ?

from what I can tell no tempdir is where programs install temp files to. There is a Temporary Internet Folder but i cannot remove the folder without deleting everything inside it.

Hmm .. there is an API called SHGetFolderPathA, with which you can obtain certain other folders in Windows.
You need to put a 'decls' file in the programfiles\blitz\userlibs folder.

You can maybe try this code, but I'm not sure if it finds the right directory. Also, I didn't test if it can delete files from that directory with DeleteFile.
;Save these lines as a textfile in the directory c:\program files\blitz3d\userlibs
;and call the file 'shell32.decls'
;-------------------------------------
;.lib "shell32.dll"

;api_GetFolderPath%(hwnd, p1, p2, p3, out*) : "SHGetFolderPathA"
;-------------------------------------
;it will enable the api_getfolderpath command


	Graphics 800, 600, 0, 2
	
	ok$ = GetInternetTempFolder$()
	
	dir = ReadDir(ok$)
	
	Repeat

		;get next file in folder	
		f$ = NextFile$(dir)
		
		;if no more files are found, exit loop
		If f$ = "" Then Exit

		;test if a file is found (else it is a subfolder)
		If FileType(ok$ + f$) = 1 Then		
		
			;print name that was found
			Print f$
			
			;ask for delete
			If Lower$(Input$("delete ?")) = "y" Then 
				;print complete filename
				Print ok$ + f$
				;delete file
				DeleteFile ok$ + f$

				;test if file exists
				If FileType(ok$ + f$) <> 1 Then Print "file was deleted"
				
			End If
		End If
	
	Forever
	
	WaitKey()	
	End

;-------------------------------------------------------------------------------------------------------
;											GetMyDocumentsPath()
;-------------------------------------------------------------------------------------------------------
;uses SHGetFolderPathA to get the mydocuments folder
Function GetInternetTempFolder$()

	bank = CreateBank(256)
	
	api_GetFolderPath(0, $20, 0, 0, bank)
	
	s$ = ""
	For i = 0 To 255
		b = PeekByte(bank, i)
		If b = 0 Then Exit
		s$ = s$ + Chr$(b)
	Next
	
	FreeBank bank
	
	If Right$(s$, 1) <> "" Then s$ = s$ + ""
	
	Return s$
	
End Function