Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

512
Vistas
net::ERR_FILE_NOT_FOUND. reactjs and mongodb error

im trying to make a social media website that you can upload videos and it will play them on the home screen. Im having problems where you can see the video you clicked on in the upload page but as soon as it refreshes the video disappears and it only shows a black screen on the video. It is on a localhost right now, which I think is the reason it wont work.

this is the link that im getting from the database: blob:http://localhost:3000/1e655870-bb8e-44e5-b35b-8a9012d31116

is there a way to make a link to a video that always exists?

here is the upload page:

 const [files, setFiles] = useState([]);
 const [title,setTitle] = useState("");
 const [userData, setUserData] = useState([])

 const onDrop = useCallback(acceptedFiles => {
   setFiles(acceptedFiles.map(file => Object.assign(file, {
   preview: URL.createObjectURL(file)
 })));
}, []);

const {
getRootProps,
getInputProps,
isDragActive,
isDragAccept,
isDragReject
} = useDropzone({
onDrop,
accept: 'video/mp4'
});

  const style = useMemo(() => ({
...baseStyle,
...(isDragActive ? activeStyle : {}),
...(isDragAccept ? acceptStyle : {}),
...(isDragReject ? rejectStyle : {})
 }), [
isDragActive,
isDragReject,
isDragAccept
]);

 const thumbs = files.map(file => (
<div key={file.name}>
  <video
  className="videoPrev"
    src={file.preview}
    alt={file.name}
    controls
    style={{maxHeight:"100mm",maxWidth:"100mm"}}
  />
  
</div>
));

useEffect(() => {
const currentUser = AuthService.getCurrentUser();

AuthService.getUser(currentUser.id).then(results => {
    console.log(results.data.user);
    setUserData(results.data.user);
}).catch(err => {
    console.log(err.message);
});

files.map(file => console.log(file.preview));
 },[])


 // clean up
 useEffect(() => () => {
  files.forEach(file => URL.revokeObjectURL(file.preview));
 }, [files]);

 function handleSubmit(){
 const url = files.map(file => (file.preview)).toString();
PostService
  .create(userData.username,title,url)
  .then(data => {
      //window.location = "/";
      console.log(data);

  }).catch(err => {
      console.log(err.message);
  });

 }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda