Ask coding questions

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

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 (3186) [earned 5 cycles]
View Answer
Commentshotnewtop
SixBeeps (3186)

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 (748)

@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 (3186)

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

EpicGamer007 (748)

@SixBeeps, Ok, well thanks for your help!

Coder100 (10480)

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 (748)

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

EpicGamer007 (748)

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

Bookie0 (4463)

Here this might be what youre looking for ;): https://repl.it/talk/learn/Replit-DB/43305

Happy coding and hope this helps! =)

EpicGamer007 (748)

@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 (4463)

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 repl.it discord and aks there, many people are active there ;) @AbhayBhat

EpicGamer007 (748)

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

Bookie0 (4463)

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