hi,
this one :
<a href='C:\Users\rdoshi\storage\{{i.file_name}}'>{{i.file_name}}</a>
should be
<a href='/media/{{i.file_name}}'>{{i.file_name}}</a>
it will point to your local webserver if in local dev (
http://127.0.0.1/media/filename) , and in prod will be from your domain (
http://yourdomain.com/media/filename)
Cheers,
Mulianto
On Mon, Sep 19, 2016 at 10:59 PM, 'Tom Evans' via Django users <
[email protected]> wrote:
> On Thu, Sep 15, 2016 at 8:21 AM, Rahul Doshi <[email protected]>
> wrote:
> > Hi ,I want to setup a dropbox like server with django. So far i have
> > achieved uploading files onto a location .I want these files to show up
> on
> > browser which they do(while saving file to the location I indexed an
> entry
> > in the Db so i just print the file names from the DB(POSTGRESQL).Now i
> want
> > to provide users options to view or download the files.I put a link on it
> > and tried ,it did not work since it shows an javascript error "NOT
> ALLOWED
> > TO LOAD LOCAL RECOURCE" . All uploaded files are loaded in C drive of my
> > laptop. Where else do i load so that javascript can load it? Attaching my
> > code ..thanks in advance.
>
>
> For security reasons, browser do not allow internet zone sites to
> access local content from javascript (otherwise, any site could read
> any accessible file from your computer and submit it, well, anywhere).
>
> Serve the files from the webserver instead.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAFHbX1LaHEEpfm_9xVx2xeVq-eJQSoevSi2eKuK2wLtj%3DwXvcA%
> 40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2BSr5mSrLnKyRgiGc-fDYdEe%2BMRkKTwYGi8kxAX%3DyAZPRGRMug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.