Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a problem, I am using backend with Codeigniter and upload the image to MySQL with varchar type.
This is the name of the image after I input:
and now I want to get that image to react native with fetch API, but how to get image from database to react native, because in MySQL just the name of the picture is saved? please help me
You have to save the file on the server's disk and filename name in your database. You'll have to know the location of your file so when you want to fetch it you'll have to build a full url to the file like http://example-domain.com/uploads/filename.jpg or you can save the full path in the database instead of just a filename. If you don't have a server to store the image you may consider saving the image blob into the database which I don't recommend.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Background
I'm creating a website where the user can store an article as a file in the database and than upload the file's content into a page in the website using a form. The file may only contain text or image or both.
Question
Can anyone walk me through this?
I would suggest you to create a database table having fields having the userId, and path of the file.
The file uploaded should be saved in the Web Server, and its path need to be saved in the database.
The vice-versa should be done while retrieving the file content.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
what is the best way to save videos in a sql server ?
i want to make a web app to save videos to the server and then retrive it back when needed
No matter which programming language you should follow :
Store video on File server
Store its path in Database while saving/editing/fetching.
You should not save the video file itself to a SQL server. Save the files to server or cloud storage and save only information related to the video in a SQL server such as title, size, uniqueID, etc.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to send the doc and pdf file to the MySQL database using php from my android application.
I have no idea about it. What shoud i write in android and php file?
Please guide me if anyone have code?
Thanking you.
You have two options:
1) Store it in a field with a BLOB data type. I really do not advise this in any way and is only listed as the first option because it pertains directly to your question.
SO has good coverage of this already Storing files in SQL Server
2) Move the file to a folder and store the file path. This is the preferred option by mmmm everyone. Use move_uploaded_file and if you are unsure of how to setup an html form take a look at W3C PHP File Upload
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create a form inside a PHP file that will allow me to type in a couple text fields and then upload those fields to certain tables/columns in my database. I can figure this out, but another option I want is to upload a song and upload an image to my webserver and then retrieve the link and upload those links to the database..
Does anyone know of a good tutorial for this?
You can find information on the php page.
Here is the link for upolading files information.
http://php.net/manual/en/features.file-upload.php
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a system that allows users to upload .doc files..I'm using PHP and renaming these files the memberid.doc so that I can determine which user uploaded that file and give him the option to delete that file. I would like to keep the file name the same though. Is there any way I can do this and still track which user uploaded that file?
You could keep a MySQL database of filenames and by which user they were uploaded.
I think you will store the files in the same folder, and worrying if a file of the same name is uploaded it would delete the older file, to prevent it from happening u have to give a new name to the file that is stored in server (something related to the user id)
the table would be
user_id filename serverFileName
filename would be name of file the user uploaded, like android.jpg
serverFilename would be the name file as stored in server like user4_1.jpg