|
Post by meerkat on Aug 6, 2019 14:08:05 GMT -5
How do I get the file path using the upload command. Upload returns the name of the file but not the path where it's located.
upload "Find a file"; dirPath$ print dirPath$ ' this is only the file name
|
|
metro
Full Member
Posts: 180
|
Post by metro on Aug 8, 2019 18:24:24 GMT -5
I see no obvious solution Dan, but then I'm not the sharpest tool in the shed the trouble is Carl is still swamped and from what I understand he is having trouble locating the code for runbasic so it could be some time before this is addressed.
y'all have a great day
|
|
|
Post by meerkat on Aug 9, 2019 14:54:36 GMT -5
Interesting! I thought Carl had given up on RB. So.. I had given up on using it for anything new.. A couple of obvious things that would make this a great language. 1. Fix the locks in SQLite or better yet give it ODBC. 2. Fix the memory leaks. When I was using RB for some real jobs, I wrote a program to kill and restart RB about every hour or so to get it to free up memory.
However after all the years without fixes, I don't have a lot of hope. But I'd move back if stuff started working.
Thanks for the info and 'ave a g'day. I think I'll just have a stubby in a isky and call it a day...
|
|
|
Post by StefanPendl on Aug 12, 2019 3:49:23 GMT -5
From the RB help: Once the file is specified, the user clicks on the 'Upload' button and the file is transmitted and saved into the default directory. ---- So the file is located in the default folder of your setup. Use DefaultDir$ for the path to the returned file name.
|
|
|
Post by meerkat on Aug 13, 2019 6:21:16 GMT -5
Hmmm! I ran the following program and ask for a file "c:\data\temp\a.html I still cannot get the PATH. I do not want the DIRECTORY.
upload "Find a file"; fil$ print "fil:";fil$ ' this is only the file name without the path print "DefaultDir:";DefaultDir$
After I clock [upload] I get the following results:
File uploaded: a.html fil:a.html DefaultDir:c:\rbp101
It returns in fil$ only the file name "a.html" and does NOT include the PATH. Looking at DefaultDIr$ after the [upload] it still points to my RB directory "c:\rbp101" and not "c:\data\temp" Anyway, even if it did return the correct pointer, it is the DIRECTROY and not the relative web PATH
So how do I get the PATH??
|
|
|
Post by StefanPendl on Aug 16, 2019 3:18:42 GMT -5
If you need a dedicated folder to have the file saved to, then you would change the contents of DefaultDir$ before executing the upload command. The full path to your file of your example would be: DefaultDir$\fil$
|
|
|
Post by meerkat on Aug 16, 2019 5:15:13 GMT -5
Ok.. I understand that. I want to know where the file came from on the client side. Not the DIR but the PATH it came from? How do I get that information??
Thanks for the help.. Dan
|
|
jerry
Junior Member
Posts: 83
|
Post by jerry on Aug 17, 2019 20:09:53 GMT -5
I see no obvious solution Dan, but then I'm not the sharpest tool in the shed the trouble is Carl is still swamped and from what I understand he is having trouble locating the code for runbasic so it could be some time before this is addressed. y'all have a great day CAN'T FIND THE CODE? Sorry, I call bullshit on this one. How does the creator/developer of runBasic lose that source code? Yeah, and I'll buy a bridge from you too....
|
|
|
Post by StefanPendl on Aug 18, 2019 2:16:29 GMT -5
If someone uploads a file to a server the source path is not visible. In general most client information is not provided to the server due to most browsers security settings.
I haven't read about source code got lost, it would be best to stop telling people things without prove of them.
|
|
|
Post by carlgundel on Aug 18, 2019 18:29:04 GMT -5
I see no obvious solution Dan, but then I'm not the sharpest tool in the shed the trouble is Carl is still swamped and from what I understand he is having trouble locating the code for runbasic so it could be some time before this is addressed. y'all have a great day CAN'T FIND THE CODE? Sorry, I call bullshit on this one. How does the creator/developer of runBasic lose that source code? Yeah, and I'll buy a bridge from you too.... I didn't lose the source code, of course. But I haven't done a build in a very long time and it will take a concerted effort to rework the build process, and right now I'm working on Liberty BASIC and this is the wrong time to shift gears. -Carl
|
|
|
Post by carlgundel on Aug 19, 2019 11:14:18 GMT -5
CAN'T FIND THE CODE? Sorry, I call bullshit on this one. How does the creator/developer of runBasic lose that source code? Yeah, and I'll buy a bridge from you too.... I didn't lose the source code, of course. But I haven't done a build in a very long time and it will take a concerted effort to rework the build process, and right now I'm working on Liberty BASIC and this is the wrong time to shift gears. To be fair, I'm not sure that I might have something like I was looking for the code, but that doesn't mean I lost it. I have lots of backups of my work but that doesn't mean that I always know where the very latest files are, so I was digging around. I did find the code, but I will need to make time to do anything with it. -Carl
|
|
metro
Full Member
Posts: 180
|
Post by metro on Aug 19, 2019 15:46:33 GMT -5
I didn't lose the source code, of course. But I haven't done a build in a very long time and it will take a concerted effort to rework the build process, and right now I'm working on Liberty BASIC and this is the wrong time to shift gears. To be fair, I'm not sure that I might have something like I was looking for the code, but that doesn't mean I lost it. I have lots of backups of my work but that doesn't mean that I always know where the very latest files are, so I was digging around. I did find the code, but I will need to make time to do anything with it. -Carl of course bullshiting is a national past time where I come from but in this case I believe I misunderstood Carl's reply to a PM sorry Carl Actually I just re-read what I posted and I believe "having trouble" in my lingo means it would be a lot of trouble ie I have better things to do ATM... and it's a (PITA) to find
|
|
jerry
Junior Member
Posts: 83
|
Post by jerry on Sept 11, 2019 15:13:02 GMT -5
To be fair, I'm not sure that I might have something like I was looking for the code, but that doesn't mean I lost it. I have lots of backups of my work but that doesn't mean that I always know where the very latest files are, so I was digging around. I did find the code, but I will need to make time to do anything with it. -Carl of course bullshiting is a national past time where I come from but in this case I believe I misunderstood Carl's reply to a PM sorry Carl Actually I just re-read what I posted and I believe "having trouble" in my lingo means it would be a lot of trouble ie I have better things to do ATM... and it's a (PITA) to find Carl, That's great news. I am dearly awaiting a revised version with all or most of the suggested additions. I have a short list is you are interested. As for Liberty Basic, when will a Linux version come out? Ive been windows free since win3.1 when I bounced to OS/2 and then on to Linux in 1995.
|
|
jerry
Junior Member
Posts: 83
|
Post by jerry on Jul 2, 2020 17:56:07 GMT -5
Any news Carl?
|
|
|
Post by meerkat on Jul 3, 2020 12:44:03 GMT -5
I finally wrote my own. It only shows the server side directories. For me, that was ok since client directories was not allowed. It uses DIR for windows, but I think Linux conversion would work using ls/la or something like that.
' --------------------------------------------- ' Directory ' --------------------------------------------- cr$ = chr$(13) dirOf$ = "c:\" ' get directory of bf$ = "<SPAN STYLE='font-family:Courier New; font-weight:700; font-size:10pt'>"
' ------------------------------------------- ' Shell out directory ' -------------------------------------------
[dirShell] cls html bf$ loc$ = strRep$(dirOf$,"*.*","") x$ = shell$("dir ";dirOf$)
i = 1 while word$(x$,i,cr$) <> "" a$ = word$(x$,i,cr$) if trim$(a$) = "" then goto [next] if left$(a$,1) = " " then goto [next] if left$(a$,1) = cr$ then goto [next] type$ = mid$(a$,26,3) size$ = mid$(a$,30,9) size$ = strRep$(size$,",","") size = val(size$) if type$ <> "DIR" and size = 0 then goto [next] name$ = mid$(a$,40) a$ = strRep$(a$,"<","[") a$ = strRep$(a$,">","]") html left$(a$,39) link #ddir,name$, [doDir] #ddir setkey(type$;"|";loc$;name$) html "<BR>" goto [next1] [next] print a$ [next1] i = i + 1 wend wait [doDir] type$ = word$(EventKey$,1,"|") name$ = word$(EventKey$,2,"|")
if type$ = "DIR" then dirOf$ = name$;"\*.*" goto [dirShell] end if print "Selected File:";name$ wait
' -------------------------------- ' string replace rep str with ' -------------------------------- FUNCTION strRep$(str$,rep$,with$) ln = len(rep$) ln1 = ln - 1 i = 1 while i <= len(str$) if mid$(str$,i,ln) = rep$ then strRep$ = strRep$ + with$ i = i + ln1 else strRep$ = strRep$ + mid$(str$,i,1) end if i = i + 1 WEND END FUNCTION
end
Hope this helps.. Dan
|
|