Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:13:56+00:00 2026-06-09T17:13:56+00:00

I have been scratching my head FileField. Does the FileField require a seperate process?

  • 0

I have been scratching my head FileField. Does the FileField require a seperate process?

Although my url gets saved .. but my file doesn’t get uploaded … what am i doing wrong?

This is my models.py …

class OpLink(models.Model):
    user = models.ForeignKey(User)
    file = models.FileField(blank=True, null=True, upload_to="uploads")
    url = models.URLField(blank=True, null=True)

my forms.py

class OpLinkForm(ModelForm):
    class Meta:
        model = OpLink
        exclude = ('user')

my views.py

oplinkform = oplinkform(request.POST)
                oplink = oplinkform.save(commit=False)
                oplink.user = user
                oplink.save()

and my html to process it.

<div class="span5">
                            {{ oplinkform.url|add_class:"span4"|attr:"Placeholder:URL for the item" }}
                            <br><h4>OR</h4><br>
                            {{ oplinkform.file|add_class:"input-file" }}
                            <br />
                            <input class='btn btn-primary btn-large' type="submit" value='Post' name='action'>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:13:58+00:00Added an answer on June 9, 2026 at 5:13 pm

    You need to include the files when creating the form

    oplinkform = oplinkform(request.POST, request.FILES)
    

    Also make sure that your form has the correct enctype

    <form enctype="multipart/form-data"></form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been scratching my head all morning behind this but still haven't been
I have been scratching my head since long now but not getting around to
I have been scratching my head on this for a while now but still
I dont know the exact problem but have been scratching my head for almost
Well, I have been scratching my head for some time now. But failed to
I have been scratching my head for a while on this one. I dont
I have been scratching my head for hours trying to figure out why this
I've been scratching my head over this for an hour... I have a list
I've been scratching my head for hours trying to figure this out. I have
I have been scratching my head for the better part of the evening on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.