Ask coding questions

← Back to all posts
How to store new files in a database?
EpicGamer007 (1607)

Hello repl.
Below as you can see is MyCMD. I am planning on adding a LOGIN and FILE STORAGE system to MyCMD. But I want to be able to store that info somewhere. Unfortunately, that is extremely difficult and I do not know how I would be able to link a Java project with a repl in a different language.

Thanks for all answers!! :)

Answered by SixBeeps (5052) [earned 5 cycles]
View Answer
SixBeeps (5052)

I believe you can use cURL calls with most DB systems out there, if not at least ReplDB does. You can learn about cURL requests in Java here

EpicGamer007 (1607)

@SixBeeps, OMG, this actually works! well, in most places...

I opened up the client in one tab then opened up the server in another tab(The server starts first).

What is great is that

  1. The server receives the connection
  2. The server send something back to the client

The bad news is...
The server sends back the html of the page and not the info that was written EVERY TIME. That is something I do not know how to fix.

Could you help me a bit with that?

Thanks. :)

SixBeeps (5052)

@AbhayBhat Ehm, this I'm not skilled enough to answer. Sorry about that!

EpicGamer007 (1607)

@SixBeeps, Ok, well thanks for your help!

Coder100 (16911)

hi!! I don't remember how to make HTTP calls in Java, but for now, you should just put inside a .csv file and parse it.

EpicGamer007 (1607)

@Coder100, A .csv file? If a user creates an account and then refreshes the page, would it still be there?

EpicGamer007 (1607)

@Coder100, If it does, then I will research that.

Bookie0 (5964)

Here this might be what youre looking for ;):

Happy coding and hope this helps! =)

EpicGamer007 (1607)

@Bookie0, Thanks a lot but I do not know JS which means I would not be able to connect my program to a JS file and the store it. I also do not know how to do it in java...

Bookie0 (5964)

maybe try searching up "how to connect my program to a JS file and the store it" on google.

Also, you could go on the discord and aks there, many people are active there ;) @AbhayBhat

EpicGamer007 (1607)

@Bookie0, I wish I had discord :(. Ok I will try searching.

Bookie0 (5964)

ok cool!
also you know you can get discord on the internet with a free account ;) @AbhayBhat